Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]

2013-01-22 Thread Martin Hewitson
OK, finally near the bottom of this problem. It turned out that I had an override of -didTurnIntoFault in my tree item entity. In there I was nil'ing out a couple of relationships (which are in principle nil'ed out by the nullify delete rule) - I did this while trying to track down some other d

Re: Coordinate conversions in CALayer

2013-01-22 Thread Graham Cox
On 22/01/2013, at 4:35 PM, Andy Lee wrote: > On Jan 21, 2013, at 5:12 PM, Graham Cox 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 do

Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Ken Thomases
On Jan 22, 2013, at 8:33 PM, Clay Heaton wrote: > While that goes full screen and does prevent process switching, it still > allows the iTunes function keys to pass through to the system (as well as the > volume controls). Pressing F8 (play/pause) launches iTunes and causes music > to play. >

Re: Best guess at expressing a string as a variable

2013-01-22 Thread jonat...@mugginsoft.com
On 23 Jan 2013, at 00:05, Jean Suisse wrote: >> >> Dealing with English seems not too troublesome but titles composed in other >> languages might be a different matter. > > Do you want to deal with other languages ? For instance Japanese, Chinese, > Korean, Arabic, etc. ? The user can enter

Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Clay Heaton
Thanks, Ken. I read the docs more carefully and looked at the full screen demo projects. As you mentioned, my understanding is that -enterFullScreenMode:withOptions: should capture the screen as long as NSFullScreenModeApplicationPresentationOptions is not present. That is confirmed in the NSV

Re: object.struct.element as lvalue

2013-01-22 Thread Matt Neuburg
On Jan 22, 2013, at 2:51 PM, John McCall wrote: > Heh. And even that is actually incorrect, because you can do things like > x.count += 6, which is translated as [x setCount: [x count] + 6] (except only > evaluating 'x' once). Ouch! > > I would say that object.struct is a special kind of l

Re: Best guess at expressing a string as a variable

2013-01-22 Thread Keary Suska
On Jan 22, 2013, at 6:18 PM, Jens Alfke wrote: > On Jan 22, 2013, at 3:28 PM, jonat...@mugginsoft.com wrote: > >> Is + (id)letterCharacterSet the best choice here? > > The API docs say "Informally, this set is the set of all characters used as > letters of alphabets and ideographs.” > Which ve

Re: Best guess at expressing a string as a variable

2013-01-22 Thread Keary Suska
On Jan 22, 2013, at 4:28 PM, jonat...@mugginsoft.com wrote: > I have a generic descriptive title of a parameter and want to express it as a > variable name within a script. > > So if my title is "No more awesome today, please!" I will likely render this > as "no-more-awesome-today-please" ( I c

Re: Best guess at expressing a string as a variable

2013-01-22 Thread Jens Alfke
On Jan 22, 2013, at 3:28 PM, jonat...@mugginsoft.com wrote: > Is + (id)letterCharacterSet the best choice here? The API docs say "Informally, this set is the set of all characters used as letters of alphabets and ideographs.” Which very strongly implies it is not just ASCII, but covers all Uni

Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Ken Thomases
On Jan 22, 2013, at 10:16 AM, Clay Heaton wrote: > That's actually what I'm doing at the moment: > >NSApplicationPresentationOptions options = > NSApplicationPresentationHideDock + > NSApplicationPresentationDisableProcessSwitching + > NSApplicationPresentationHideMenuBar; >NSNumber *

Re: Best guess at expressing a string as a variable

2013-01-22 Thread Jean Suisse
On 23 janv. 2013, at 00:28, "jonat...@mugginsoft.com" wrote: > I have a generic descriptive title of a parameter and want to express it as a > variable name within a script. > > So if my title is "No more awesome today, please!" I will likely render this > as "no-more-awesome-today-please" (

Best guess at expressing a string as a variable

2013-01-22 Thread jonat...@mugginsoft.com
I have a generic descriptive title of a parameter and want to express it as a variable name within a script. So if my title is "No more awesome today, please!" I will likely render this as "no-more-awesome-today-please" ( I can define the separator style). I am targeting about 20 or so scriptin

Re: object.struct.element as lvalue

2013-01-22 Thread John McCall
On Jan 22, 2013, at 11:59 AM, Matt Neuburg wrote: > On Jan 22, 2013, at 11:25 AM, John McCall wrote: >> On Jan 22, 2013, at 11:03 AM, Matt Neuburg wrote: >>> We have dot-syntax for accessors, and we have dot-syntax for struct >>> elements, and we can chain them, but not as an lvalue. It is lega

Re: How to avoid warning?

2013-01-22 Thread Dave
On 22 Jan 2013, at 21:27, Jens Alfke wrote: On Jan 22, 2013, at 10:15 AM, Dave wrote: This has to work with classes that exist already as well as classes that don't. If initWithManager is defined in the class in question "knows" what it is being called like this, if not then it default

Re: How to avoid warning?

2013-01-22 Thread Jens Alfke
On Jan 22, 2013, at 10:15 AM, Dave wrote: > This has to work with classes that exist already as well as classes that > don't. If initWithManager is defined in the class in question "knows" what it > is being called like this, if not then it defaults to the regular NSObject > init. > > For in

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

2013-01-22 Thread David Duncan
On Jan 22, 2013, at 12:34 PM, Charles Srstka wrote: > int64_t delayInSeconds = 2; > dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * > NSEC_PER_SEC); > dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ > [foo doSomethingWith:bar]; > }); Just note that th

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

2013-01-22 Thread Charles Srstka
(Resending since I accidentally sent the first one from the wrong e-mail address. Please reply to this one instead of the other to avoid re-posting my private e-mail address to the list, where it will be vulnerable to spambots. Thanks!) On Jan 22, 2013, at 1:38 PM, Rick Aurbach wrote: > Thank

Re: object.struct.element as lvalue

2013-01-22 Thread Matt Neuburg
On Jan 22, 2013, at 11:25 AM, John McCall wrote: > On Jan 22, 2013, at 11:03 AM, Matt Neuburg wrote: >> We have dot-syntax for accessors, and we have dot-syntax for struct >> elements, and we can chain them, but not as an lvalue. It is legal to say >> >> x = object.struct.element >> >> and >

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

2013-01-22 Thread Rick Aurbach
Thank you for the explanation. I only started learning Objective-C, Cocoa, iOS, etc in August, so I'm still pretty much a newbie and appreciate learning something new. In this particular case, the selector that is the argument to the performSelector: method is a callback selector for NSTimer an

Re: How to avoid warning?

2013-01-22 Thread Charles Srstka
On Jan 22, 2013, at 1:28 PM, Andy Lee wrote: > On Jan 22, 2013, at 2:19 PM, Charles Srstka wrote: > >> On Jan 22, 2013, at 12:58 PM, Andy Lee wrote: >> >>> // Or this also works (protocol). >>> @protocol AvoidCompilerWarning >>> - (id)initWithArg:(id)arg; >>> @end >> >> Really, a protocol is

Re: How to avoid warning?

2013-01-22 Thread Andy Lee
On Jan 22, 2013, at 2:19 PM, Charles Srstka wrote: > On Jan 22, 2013, at 12:58 PM, Andy Lee wrote: > >> // Or this also works (protocol). >> @protocol AvoidCompilerWarning >> - (id)initWithArg:(id)arg; >> @end > > Really, a protocol is what you ought to be doing. Make a protocol with > -initW

Re: object.struct.element as lvalue

2013-01-22 Thread John McCall
On Jan 22, 2013, at 11:03 AM, Matt Neuburg wrote: > We have dot-syntax for accessors, and we have dot-syntax for struct elements, > and we can chain them, but not as an lvalue. It is legal to say > > x = object.struct.element > > and > > object.struct = f > > and > > struct.element = x > >

Re: How to avoid warning?

2013-01-22 Thread Charles Srstka
On Jan 22, 2013, at 12:58 PM, Andy Lee wrote: > // Or this also works (protocol). > @protocol AvoidCompilerWarning > - (id)initWithArg:(id)arg; > @end Really, a protocol is what you ought to be doing. Make a protocol with -initWithManager: in it, and then make all the classes that might get pas

Re: How to avoid warning?

2013-01-22 Thread Jens Alfke
On Jan 22, 2013, at 9:23 AM, Dave wrote: >> 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) > > The class name is passed in as a string and the class is formed from that, so > I can't pre-declar

object.struct.element as lvalue

2013-01-22 Thread Matt Neuburg
We have dot-syntax for accessors, and we have dot-syntax for struct elements, and we can chain them, but not as an lvalue. It is legal to say x = object.struct.element and object.struct = f and struct.element = x but not object.struct.element = x I suppose this is because you can't use

Re: How to avoid warning?

2013-01-22 Thread Andy Lee
On Jan 22, 2013, at 1:26 PM, Jens Alfke wrote: > > On Jan 22, 2013, at 9:24 AM, Dave wrote: > >> Ok, cool, thanks for that, I still have the same problem though when I call >> the initWithManager. > > Others answered this already. To recap: The compiler needs to see a > declaration of an -in

Re: How to avoid warning?

2013-01-22 Thread John McCall
On Jan 22, 2013, at 9:23 AM, Dave wrote: > That's wont help because myClass is a variable created from a String. But it will help, because Quincey's suggestion is not contingent on the type of the object that you send the message to. The compiler is merely asking that you have declared a metho

Re: How to avoid warning?

2013-01-22 Thread Dave
On 22 Jan 2013, at 18:26, Jens Alfke wrote: On Jan 22, 2013, at 9:24 AM, Dave wrote: Ok, cool, thanks for that, I still have the same problem though when I call the initWithManager. Others answered this already. To recap: The compiler needs to see a declaration of an -initWithManager:

Re: How to avoid warning?

2013-01-22 Thread Jens Alfke
On Jan 22, 2013, at 9:24 AM, Dave wrote: > Ok, cool, thanks for that, I still have the same problem though when I call > the initWithManager. Others answered this already. To recap: The compiler needs to see a declaration of an -initWithManager: method before it parses this line. So you have

Re: How to avoid warning?

2013-01-22 Thread Dave
On 22 Jan 2013, at 18:07, Keary Suska wrote: On Jan 22, 2013, at 10:23 AM, Dave wrote: On 21 Jan 2013, at 18:44, Steve Sisak wrote: At 6:14 PM + 1/21/13, Dave wrote: if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO) myObj = [[myClass alloc] init]; else

Re: How to avoid warning?

2013-01-22 Thread Dave
On 22 Jan 2013, at 17:34, Jean Suisse wrote: myObj = [[myClass alloc] performSelector(@selector ("initWithManager:") withObject:self]; Would this work? You could do : id myObj =[myClass alloc]; myObj = [myObj performSelector(@selector("initWithManager:") withObject:myObj]; Thanks f

Re: How to avoid warning?

2013-01-22 Thread Keary Suska
On Jan 22, 2013, at 10:23 AM, Dave wrote: > > On 21 Jan 2013, at 18:44, Steve Sisak wrote: > >> At 6:14 PM + 1/21/13, Dave wrote: >>> if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO) >>> myObj = [[myClass alloc] init]; >>> else >>> myObj = [[myClass alloc] ini

Re: How to avoid warning?

2013-01-22 Thread Jean Suisse
On 22 janv. 2013, at 18:34, Jean Suisse wrote: > >> myObj = [[myClass alloc] performSelector(@selector("initWithManager:") >> withObject:self]; >> >> Would this work? >> > > > You could do : > > id myObj =[myClass alloc]; > myObj = [myObj performSelector(@selector("initWithManager:") > w

Re: How to avoid warning?

2013-01-22 Thread Jean Suisse
> myObj = [[myClass alloc] performSelector(@selector("initWithManager:") > withObject:self]; > > Would this work? > You could do : id myObj =[myClass alloc]; myObj = [myObj performSelector(@selector("initWithManager:") withObject:myObj]; ___ Cocoa

Re: How to avoid warning?

2013-01-22 Thread Dave
On 21 Jan 2013, at 22:12, Jens Alfke wrote: On Jan 21, 2013, at 10:14 AM, Dave 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: @select

Re: How to avoid warning?

2013-01-22 Thread Dave
On 21 Jan 2013, at 18:44, Steve Sisak wrote: 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 initWithMana

Re: How to avoid warning?

2013-01-22 Thread Dave
That's wont help because myClass is a variable created from a String. as in: -void methodXXX:(NSString*) theClassName myClass = NSClassFromString(theClassName); if (myClass == nil) return; myObj = [[myClass alloc] initWithManager:self]]; } To whoever said write better code that has t

Re: Issue with Core Data Mapping Model

2013-01-22 Thread Sean McBride
On Thu, 17 Jan 2013 21:45:51 -0500, John Brayton said: >I am building a mapping model between two versions of my Core Data >model, and I am encountering a strange issue: > >* If I define six of the seven entity mappings I need in the mapping >model, migrating the data works as expected. > >* When

Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Clay Heaton
That's actually what I'm doing at the moment: NSApplicationPresentationOptions options = NSApplicationPresentationHideDock + NSApplicationPresentationDisableProcessSwitching + NSApplicationPresentationHideMenuBar; NSNumber *presentationOptions = [NSNumber numberWithUnsignedLong:options]

Re: NSPointerArray on iOS - truly __weak?

2013-01-22 Thread Kyle Sluder
On Tue, Jan 22, 2013, at 07:54 AM, Matt Neuburg wrote: > That just repeats the question - as I said (and you quoted), "are the > docs just lying?" The point is that I prefer not to guess. I would like > to be told officially that on iOS (not Mac OS X) these classes are doing > ARC-__weak references

Re: How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Kyle Sluder
On Tue, Jan 22, 2013, at 07:50 AM, Clay Heaton wrote: > > I've read through the Apple display capturing guide, yet I always end up > with a black screen (instead of the proper contents of my NSOpenGLView) > when I try to capture the display. I suspect that I'm not assigning the > proper context wh

Re: NSPointerArray on iOS - truly __weak?

2013-01-22 Thread Matt Neuburg
That just repeats the question - as I said (and you quoted), "are the docs just lying?" The point is that I prefer not to guess. I would like to be told officially that on iOS (not Mac OS X) these classes are doing ARC-__weak references under ARC when asked for weak behavior. m. On Jan 22, 2013

How do I use CGDisplayCapture() to capture an NSOpenGLView in a XIB?

2013-01-22 Thread Clay Heaton
OS X / Cocoa question: I have a subclass of NSOpenGLView in a XIB (working with cocos2d). I want to capture the screen to disable the function keys, process switching, etc. while the app is running. Given that I have an IBOutlet to the NSOpenGLView, how do I capture the screen in the App Deleg

Re: Printing a view + landscape printing

2013-01-22 Thread Kyle Sluder
On Tue, Jan 22, 2013, at 02:20 AM, Jean Suisse wrote: > Now, the result fits one page, in landscape mode. However, the > aspect/ratio of the view remains the same as displayed on screen. > How can I change the size (bounds) of the view and its subview but for > printing only ? I could stretch the r

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

2013-01-22 Thread Matt Neuburg
Well discussed here: http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown m. On Jan 22, 2013, at 1:29 AM, cocoa-dev-requ...@lists.apple.com wrote: > Date: Mon, 21 Jan 2013 15:20:44 -0500 > From: Rick Aurbach > To: "cocoa-dev@lists.apple.co

Re: NSPointerArray on iOS - truly __weak?

2013-01-22 Thread Mike Abdullah
On 10 Dec 2012, at 20:26, Matt Neuburg wrote: > Bump. I'd still like to hear about this. The docs have a *huge* box saying > that iOS NSPointerArray is not doing __weak references, but it sure looks to > me like it is. But I don't know how to test. Thanks for any help. m. > > On Fri, 30 Nov 2

Re: Printing a view + landscape printing

2013-01-22 Thread Jean Suisse
On 22 janv. 2013, at 10:29, Graham Cox wrote: > On 22/01/2013, at 7:50 PM, Jean Suisse wrote: > >> Thank you very much for your reply. >> I can now print the right view. This view (Parent View) has only two large >> custom subviews in which I display graphics. >> >>> AFAIK, fit-to-page is not a

Re: Printing a view + landscape printing

2013-01-22 Thread Graham Cox
All you should need to do is to set the (h,v) pagination mode of the NSPrintInfo to NSFitPagination. That's all I do to scale my entire document to a single piece of paper, and it "just works" in that it takes into account the paper orientation and everything for you. Note that the view doesn't

Re: Printing a view + landscape printing

2013-01-22 Thread Jean Suisse
Thank you very much for your reply. I can now print the right view. This view (Parent View) has only two large custom subviews in which I display graphics. Currently, when I print Parent View, it is vertically spanned over two pages (which are printed) and horizontally spanned over two pages (wh