Re: How to add the cells(views) in a columnwise instead of Rowwise in PXListView?

2013-01-21 Thread Muthulingam Ammaiappan
i am modifying the PXListView as per my requirement...(please refer the
ThumbnailListView.png)

the main problem is PXListView having one column and cells are added in a
new row. but what i needed is i need a One Row and cells should be added
in the columns).

can anyone please help me how i can able to solve this problem...?

please point out in which function i need to modify?

-Muthu

On Mon, Jan 21, 2013 at 5:35 PM, Muthulingam Ammaiappan 
muthulinga...@gmail.com wrote:

 Hi All,

 i am modifying the PXListView as per my requirement...(please refer the
 ThumbnailListView.png)

 the main problem is PXListView having one column and cells are added in a
 new row...
 but what i needed is i need a One Row and cells should be added in the
 columns).

 can anyone please help me how i can able to solve this problem...?

 please point out in which function i need to modify?

 Regards,
 Muthu



 On Mon, Jan 21, 2013 at 9:56 AM, Muthulingam Ammaiappan 
 muthulinga...@gmail.com wrote:

 Hi Jonathan ,

 thanks for your reply...after investigating the IKImageBrowserView wont
 offer the variable cell sizes...


 *my requirements are following:*

 1.i need a List View which will allows the user to add the Thumbnail
 Image of the video clip with variable cell size(width will be varied based
 on the duration of the video clip)
 2.remove the thumbnail cell
 3.select the thumbnail cell(selection will be highlighted)
 4.reorder the items(Thumbnail Cells) in the ListView



 i found some of the open source projects(similar to NSCollectionView)
 which are providing the variable cell size(variable height).but i need
 the variable width size..here are the following

 for example :
 1.PXListView (https://github.com/Perspx/PXListView)
 2.SDListView (https://github.com/arbales/SDListView)
 3.AMCollectionView(http://www.harmless.de/cocoa-code.php)

 can any one suggest which one is the best suitable for my requirement?
  if none of those are not suitable for me... can anyone suggest the the
 best open source library which will fulfill my requirement?

 Thanks  Regards,
 Muthu



 On Wed, Jan 16, 2013 at 8:03 PM, jonat...@mugginsoft.com 
 jonat...@mugginsoft.com wrote:


 On 16 Jan 2013, at 11:39, Muthulingam Ammaiappan 
 muthulinga...@gmail.com wrote:

  Hi friends,
 
  i am developing cocoa application on mac os x, which will allows the
 user
  to import the video clips and make the movie from those video
 clips.here i
  need to deal with highly customized view(please refer the
 attachment)...
 
  *my requirement is:*
 
  -moment user add the video clip it will be added to the container
  view(which contains all the inserted video clips) and represent as a
  thumbnail. -each and every thumbnail item should have the different
 width
  based on the duration of the video clip(for example : if i consider the
  container view width is 120 pixel and make equal to 2 mins(120 sec)...
 then
  if user add the video clip which duration is 10sec then thumbnail width
  should be 10 pixel).. for that i needed the thumbnail item(cell) size
  should be variable at runtime based on the incoming video clips
 duration...
  -slider playloc functionality to see the progress while user play the
  main movie..
 
  *my approach:*
 
  - i have created the NSView which is having IKImageBrowserView
 (thumnail
  container)and NSScrollView -and custom playloc button which is
 getting
  animated its position based on the progress value...
 
  *problem: *
 
  -rightnow i am not able to set the cell size for each and every item
  differently...because it is a member function of IKImageBrowserView...
 
  if i call [imageBrowser setCellSize:];then it applies to all the
 cells...
  not for a particular cell...
 
  can any one suggest how to fix this problem..?
 
  and is it possible to set the variable cell size for each and every
 cells
  in IKImageBrowserView?
 
  what about the NSCollectionView? whether it is possible to set the
  different size for each and every cell in NSCollectionView?..
 
  can anyone please help me to fix this problem
 
  Thanks  Regards,

 The IKImageBrowserView API probably does not offer the sort of
 functionality you are after.
 NSScrollView can handle multiple views of various frame widths - insert
 the clip handling views a subviews.
 However, IKImageBrowserCell certainly doesn't look as if it is designed
 for subclassing.

 If you have to press on with IKImageBrowserView you could try creating
 individual instances for each clip (the view will host one item so you can
 set the cell width as you require) and embed those in an NSScrollView.
 There may be performance and/or presentation issues with this approach.

 This sounds like the sort of project that needs a custom view - if you
 have the time or inclination.

 Regards

 Jonathan Mitchell
 Mugginsoft LLP


 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator 

Printing a view + landscape printing

2013-01-21 Thread Jean Suisse
Dear All,

I have a non-document based application to which I would like to add printing 
support.
The main window (the one in the .xib created by default by Xcode) contains a 
split view.

Currently, when printing, I get only the left pane of the split view (at best) 
or the control that has the focus (a textfield for instance) at worse.
What would be the minimum change to perform in order to get the view in the 
right side of the split view to print itself in landscape (I would like to 
offer landscape by default to the user) ? I am happy with the rest of the print 
flow the way it is.
Any pointers ?

Thanks,
Jean

P.S.: I saw the Laying Out Page Content section in Printing Programming Guide, 
but I don't get how it is decided that the content of the view exceeds the size 
of a single page. I would prefer my view to be told to fit the selected page 
size (It is possible in my particular situation. I am printing graphics that 
can be resized to any size, to any ratio).

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to add the cells(views) in a columnwise instead of Rowwise in PXListView?

2013-01-21 Thread jonat...@mugginsoft.com
On 21 Jan 2013, at 09:41, Muthulingam Ammaiappan muthulinga...@gmail.com 
wrote:

 i am modifying the PXListView as per my requirement...(please refer the
 ThumbnailListView.png)
 
 the main problem is PXListView having one column and cells are added in a
 new row. but what i needed is i need a One Row and cells should be added
 in the columns).
 
 can anyone please help me how i can able to solve this problem...?
 
 please point out in which function i need to modify?
 
 -Muthu

I doubt that there is a single function fix for this.
If PXListView seems like a good initial point to depart from then you will have 
to refactor accordingly.
In principle though it should be fairly straightforward.

Jonathan
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Printing a view + landscape printing

2013-01-21 Thread Jean Suisse
Answering a part of my question: 

The menu item for printing needs to be re-wired to target the app delegate 
rather than the first responder.
Now, I need to fix the page orientation and determine the size in points for 
the rendering. Any ideas ?



On 21 janv. 2013, at 16:17, Jean Suisse jean.li...@gmail.com wrote:

 Dear All,
 
 I have a non-document based application to which I would like to add printing 
 support.
 The main window (the one in the .xib created by default by Xcode) contains a 
 split view.
 
 Currently, when printing, I get only the left pane of the split view (at 
 best) or the control that has the focus (a textfield for instance) at worse.
 What would be the minimum change to perform in order to get the view in the 
 right side of the split view to print itself in landscape (I would like to 
 offer landscape by default to the user) ? I am happy with the rest of the 
 print flow the way it is.
 Any pointers ?
 
 Thanks,
 Jean
 
 P.S.: I saw the Laying Out Page Content section in Printing Programming 
 Guide, but I don't get how it is decided that the content of the view exceeds 
 the size of a single page. I would prefer my view to be told to fit the 
 selected page size (It is possible in my particular situation. I am printing 
 graphics that can be resized to any size, to any ratio).
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Printing a view + landscape printing

2013-01-21 Thread Keary Suska
On Jan 21, 2013, at 8:17 AM, Jean Suisse wrote:

 I have a non-document based application to which I would like to add printing 
 support.
 The main window (the one in the .xib created by default by Xcode) contains a 
 split view.
 
 Currently, when printing, I get only the left pane of the split view (at 
 best) or the control that has the focus (a textfield for instance) at worse.

This likely has to do with which view is the first responder, and so is 
receiving a -print: action that has a nil target. Although that is how the menu 
is wired by default, I rarely find it useful. I generally use a custom method 
(one not implemented by any NSResponder class), so you can capture the print 
request.

 What would be the minimum change to perform in order to get the view in the 
 right side of the split view to print itself in landscape (I would like to 
 offer landscape by default to the user) ? I am happy with the rest of the 
 print flow the way it is.

IIRC, unless otherwise specified, all built-in printing methods will use 
+[NSPrintInfo sharedPrintInfo] to determine page settings. You can customize 
your own NSPrintInfo and call +setSharedPrintInfo:. Or you can create your own 
printing session and pass the print info to it.

 P.S.: I saw the Laying Out Page Content section in Printing Programming 
 Guide, but I don't get how it is decided that the content of the view exceeds 
 the size of a single page. I would prefer my view to be told to fit the 
 selected page size (It is possible in my particular situation. I am printing 
 graphics that can be resized to any size, to any ratio).

AFAIK, fit-to-page is not a Cocoa printing system feature. You will have to do 
that yourself. In theory, the easiest way would be to determine the scaling 
factor needed and set that in the NSPrintInfo. NSPrintInfo will tell you the 
paper size and margins, from which you can determine the printable area, then 
dividing that by the view frame or bounds.

HTH,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to avoid warning?

2013-01-21 Thread Dave

Hi All,

I have the following code:

if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)
myObj = [[myClass alloc] init];
else
myObj = [[myClass alloc] initWithManager:sel]];


I get a warning on the initWithManager: statement (Obviously), how to  
avoid the warning or otherwise fix it?


Thanks in Advance
Dave

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread David Duncan
On Jan 21, 2013, at 10:14 AM, Dave d...@looktowindward.com wrote:

 Hi All,
 
 I have the following code:
 
 if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)
   myObj = [[myClass alloc] init];
 else
   myObj = [[myClass alloc] initWithManager:sel]];
 
 
 I get a warning on the initWithManager: statement (Obviously), how to avoid 
 the warning or otherwise fix it?


What warning do you get? (Its not obvious from context).
--
David Duncan


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread Tom Davie
On 21 Jan 2013, at 18:14, Dave d...@looktowindward.com wrote:

 Hi All,
 
 I have the following code:
 
 if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)
   myObj = [[myClass alloc] init];
 else
   myObj = [[myClass alloc] initWithManager:sel]];
 
 
 I get a warning on the initWithManager: statement (Obviously), how to avoid 
 the warning or otherwise fix it?

Simple,

Write better code where you know the types you're dealing with ;).

Bob
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread Robert Martin
 myObj = [[myClass alloc] initWithManager:sel]];

Is sel meant to be self?

On Jan 21, 2013, at 1:14 PM, Dave d...@looktowindward.com wrote:

 Hi All,
 
 I have the following code:
 
 if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)
   myObj = [[myClass alloc] init];
 else
   myObj = [[myClass alloc] initWithManager:sel]];
 
 
 I get a warning on the initWithManager: statement (Obviously), how to avoid 
 the warning or otherwise fix it?


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread Quincey Morris
On Jan 21, 2013, at 10:14 , Dave d...@looktowindward.com wrote:

   myObj = [[myClass alloc] initWithManager:sel]];
 
 
 I get a warning on the initWithManager: statement (Obviously), how to avoid 
 the warning or otherwise fix it?

You need to #import a header file with an @interface declaration for the 
'initWithManager:' method.

The rule is that when the compiler sees a message send to a receiver of type 
'id' (which is the return type of 'alloc'), it needs to have seen *some* 
declaration of that method. If it has seen more than one declaration, BTW, the 
declarations must all be compatible in terms of parameter and return types.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread Steve Sisak

At 6:14 PM + 1/21/13, Dave wrote:

if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)
myObj = [[myClass alloc] init];
else
myObj = [[myClass alloc] initWithManager:sel]];

I get a warning on the initWithManager: statement (Obviously), how 
to avoid the warning or otherwise fix it?


You could try declaring initWithManager: in a category on the class 
visible only to your implementation code. (i.e. at the top of your .m 
file)


HTH,

-Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[ANN] v 0.3 of MPWDrawingContext, a pleasant Objective-C drawing context updated with blocks

2013-01-21 Thread Marcel Weiher
Hi folks,

just a heads-up that I just pushed v 0.3 of MPWDrawingContext to github:
https://github.com/mpw/MPWDrawingContext

The major enhancements have to do with using blocks for bracketing operations ( 
save/restore graphics state, shadow on/off, transparency layer begin/end) and 
delayed/repeated drawing, including patterns.  Especially the latter manages to 
unify a lot of slightly different code-paths and removes a lot of boilerplate.  
 You can let the context automatically choose the 'best' representation for 
repeated drawing or control the choice yourself with minimal changes to code.

In addition, there's support for using single object arguments to messages like 
moveto:, lineto: and translate:, in addition to the versions taking two floats 
(moveto:: , lineto::, translate:: ).

More here:   
http://blog.metaobject.com/2013/01/more-objective-c-drawing-context.html

Hope this is useful.

Marcel


On Jun 16, 2012, at 21:37 , Marcel Weiher marcel.wei...@gmail.com wrote:

 MPWDrawingContext is a light-weight Objective-C wrapper around CoreGraphics 
 CGContextRef and corresponding functions.
 
 Code is on Github:https://github.com/mpw/MPWDrawingContext
 
 Infrequently Asked Questions:
 
 Why would anyone need an Objective-C drawing context?
 
 In short, while CoreGraphics is an awesome graphics subsystem, not having OO 
 features makes CGContext closed to extension by anyone but Apple, and 
 somewhat unpleasant to use, IMHO.
 
 I explain a bit more about the motivation on my blog:   
 http://blog.metaobject.com/2012/06/pleasant-objective-c-drawing-context.html
[...]
 Who cares about less code?
 
 Well, it\s not just less code, it's more pleasant code as well:
 
   [context moveto:0 :0] lineto:100 :0] lineto:50 :50] closepath] 
 stroke];
 
 vs.
 
   CGContextMoveToPoint( context, 0, 0 );
   CGContextAddLineToPoint( context, 100, 0);
   CGContextAddLineToPoint( context, 50, 50 );
   CGContextClosePath( context );
   CGContextFillPath( context );
 
 And
 
   bitmapContext = [MPWCGDrawingContext rgbBitmapContext:NSMakeSize( 595, 
 842 )];
 
 vs.
   
   bitmapContext = CGBitmapContextCreate(NULL, size.width, size.height, 8, 
 0,
CGColorSpaceCreateDeviceRGB(),   
kCGImageAlphaPremultipliedLast)  | 
 kCGBitmapByteOrderDefault );
 
 
 No it's not!
 
 OK :-)
 
 
 Marcel
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How can I get rid of this warning message?

2013-01-21 Thread Rick Aurbach
I am attempting to use the RTPTimer wrapper that Gordon Apple contributed to 
this list. (Thanks, Gordon!)

It appears to work great, but I find that the class's executeSelector: method 
generates a warning message.

 - (void) executeSelector:(NSTimer*)timer {
if(self.target != nil) {
if([self.target respondsToSelector:self.sel]) 
[self.target performSelector:self.sel withObject:self];
}
else
[self invalidate];
 }

where sel is defined as @property(nonatomic) SEL sel;

The line containing the performSelector:withObject: method generates
PerformSelector may cause a leak because its selector is unknown.

Ok, I agree that the selector is unknown, but we know from the previous line 
that the target responds to it. So I'd like to prevent this particular warning. 
I'm sure I ought to know how do do this, but how do I go about removing this 
warning message? Ideally, I'd like to do this on a file (or occurrence) basis, 
so that I can make sure that other similar usages are similarly safe.

Cheers,

Rick Aurbach
Aurbach  Associates, Inc.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: How can I get rid of this warning message?

2013-01-21 Thread Julius Oklamcak
 Ok, I agree that the selector is unknown, but we know from the
 previous line that the target responds to it. So I'd like to
 prevent this particular warning. I'm sure I ought to know how
 do do this, but how do I go about removing this warning message?
 Ideally, I'd like to do this on a file (or occurrence) basis, so
 that I can make sure that other similar usages are similarly safe.

#pragma clang diagnostic ignored -Warc-performSelector-leaks

is the #pragma that you are looking for... :)

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How can I get rid of this warning message?

2013-01-21 Thread Charles Srstka
On Jan 21, 2013, at 2:20 PM, Rick Aurbach r...@aurbach.com wrote:

 I am attempting to use the RTPTimer wrapper that Gordon Apple contributed to 
 this list. (Thanks, Gordon!)
 
 It appears to work great, but I find that the class's executeSelector: method 
 generates a warning message.
 
 - (void) executeSelector:(NSTimer*)timer {
   if(self.target != nil) {
   if([self.target respondsToSelector:self.sel]) 
   [self.target performSelector:self.sel withObject:self];
   }
   else
   [self invalidate];
 }
 
 where sel is defined as @property(nonatomic) SEL sel;
 
 The line containing the performSelector:withObject: method generates
 PerformSelector may cause a leak because its selector is unknown.
 
 Ok, I agree that the selector is unknown, but we know from the previous line 
 that the target responds to it. So I'd like to prevent this particular 
 warning. I'm sure I ought to know how do do this, but how do I go about 
 removing this warning message? Ideally, I'd like to do this on a file (or 
 occurrence) basis, so that I can make sure that other similar usages are 
 similarly safe.

The reason it gives that warning is because you're using ARC. Because ARC uses 
selector naming conventions to determine certain behaviors, such as whether an 
object returned from a method should be retained or not, if ARC doesn't know 
what selector is actually being used here, it doesn't know how it should manage 
memory for any object returned from this method, conceivably resulting in 
crashes or leaks.

I'd suggest you have a look at dispatch_after instead of NSTimer — it uses a 
more modern blocks-based interface instead of the old target/selector stuff, 
which is often easier to use than target/selector as well as being more 
flexible and compatible with both ARC and Xcode's Refactor feature (it's very 
annoying to refactor a method only to get unexpected runtime exceptions later 
because something was calling the method via @selector, and the refactor 
process didn't pick it up).

Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get rid of this warning message?

2013-01-21 Thread Greg Parker
On Jan 21, 2013, at 12:20 PM, Rick Aurbach r...@aurbach.com wrote:
 It appears to work great, but I find that the class's executeSelector: method 
 generates a warning message.
 
 - (void) executeSelector:(NSTimer*)timer {
   if(self.target != nil) {
   if([self.target respondsToSelector:self.sel]) 
   [self.target performSelector:self.sel withObject:self];
   }
   else
   [self invalidate];
 }
 
 where sel is defined as @property(nonatomic) SEL sel;
 
 The line containing the performSelector:withObject: method generates
 PerformSelector may cause a leak because its selector is unknown.
 
 Ok, I agree that the selector is unknown, but we know from the previous line 
 that the target responds to it.

That's not what it's complaining about. It's complaining because the ARC 
compiler cannot see the name of the method you are calling, so ARC doesn't know 
whether its return value needs to be released. 


 So I'd like to prevent this particular warning. I'm sure I ought to know how 
 do do this, but how do I go about removing this warning message? Ideally, I'd 
 like to do this on a file (or occurrence) basis, so that I can make sure that 
 other similar usages are similarly safe.

If you know the selectors you are calling do not return a retained object, you 
can use #pragma clang diagnostic to disable warning -Warc-performSelector-leaks 
around that line.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to avoid warning?

2013-01-21 Thread Jens Alfke

On Jan 21, 2013, at 10:14 AM, Dave d...@looktowindward.com wrote:

 if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO)

Off-topic: instead of using the Obj-C runtime’s C API, you can express this as
if ([myClass instancesRespondToSelector: @selector(initWithManager:)] 
== NO)

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Coordinate conversions in CALayer

2013-01-21 Thread Graham Cox
Hi all,

Recently I built an (experimental) app around CALayer and friends which 
implements a vector schematic editor.

I found that CALayer isn't, not too surprisingly, really a good base for vector 
graphics - CAShapeLayer is nice enough but there's nothing for text and I 
rapidly ran into problems when trying to zoom into my view when layer objects 
became too large and started hitting OpenGL limits. I also found that 
supporting printing and capture to PDF needs a fair bit of work. The ability to 
perform easy animations is nice but not really important for the application 
here.

So I'm looking into implementing a CALayer-like architecture but which just 
draws using Core Graphics functions in the normal manner. Fairly 
straightforward but I'm having a bit of difficulty with methods such as 
-convertRect:toLayer:

My question is, is there a way to directly convert coordinates between two 
unrelated layers in a tree, or are these methods implemented by recursion up to 
a common parent node and then back down to the target layer? If I had some hint 
of how this was done in the real CALayer architecture it would help me avoid 
wasting time trying various blind alleys.

--Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Coordinate conversions in CALayer

2013-01-21 Thread Andy Lee
On Jan 21, 2013, at 5:12 PM, Graham Cox graham@bigpond.com wrote:
 My question is, is there a way to directly convert coordinates between two 
 unrelated layers in a tree, or are these methods implemented by recursion up 
 to a common parent node and then back down to the target layer? If I had some 
 hint of how this was done in the real CALayer architecture it would help me 
 avoid wasting time trying various blind alleys.

Unless and until someone chimes in with a more sophisticated solution, you 
could convert the rect from layer A to the root layer, and from the root layer 
to layer B, then find out if that bogs down performance.

Say you already have:

- (CGRect)convertRectFromSuperlayer:(CGRect)superRect;
- (CGRect)convertRectToSuperlayer:(CGRect)localRect;

Then you could have:

// Composed in Mail without regard for efficiency.
- (CGRect)convertRectToRootLayer:(CGRect)localRect
{
CGRect result = localRect;
MyLayer *layer = self;
while ([layer superlayer])
{
result = [layer convertRectToSuperlayer:result];
layer = [layer superlayer];
}
return result;
}

// Recursion.
- (CGRect)convertRectFromRootLayer:(CGRect)rootRect
{
if ([self superlayer] == nil)
{
return rootRect;
}
CGRect superRect = [[self superlayer] convertRectFromRootLayer:rootRect];
return [self convertRectFromSuperlayer:superRect];
}

// Assumes otherLayer has same root layer.
- (CGRect)convertRect:(CGRect)localRect toLayer:(MyLayer *)otherLayer
{
CGRect rootRect = [self convertToRootLayer:localRect];
return [otherLayer convertFromRootLayer:rootRect];
}

--Andy

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Excluding a XIB from project depending on configuration

2013-01-21 Thread Oleg Krupnov
I have a XIB file with some debugging  tweaking window which is only
needed in the Debug configuration of my project. I can exclude the
debug code with some #ifdefs, but I would like also to exclude the XIB
from the release build. Is there a way in Xcode to achieve this?

Thanks!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Excluding a XIB from project depending on configuration

2013-01-21 Thread Quincey Morris
On Jan 21, 2013, at 22:15 , Oleg Krupnov oleg.krup...@gmail.com wrote:

 I have a XIB file with some debugging  tweaking window which is only
 needed in the Debug configuration of my project. I can exclude the
 debug code with some #ifdefs, but I would like also to exclude the XIB
 from the release build. Is there a way in Xcode to achieve this?

You could add a script phase after the copy resources phase of the target. 
Something like:

cd $TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
rm -fv */MyWindow.nib

(assuming the nib is localized), and check Run script only when installing.

This doesn't exactly keep the nib file out of the release build. Rather, it 
keeps it out of the archive build, which is the fully-processed app you 
presumably generate to distribute.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com