NSView subclass does not call designated initializer

2011-08-22 Thread allan greenier
This is for an iPhone app.I've made a subclass (named Box) of NSView, Xcode 4.1 made it with a designated initializer for me to fill out. - (id)initWithFrame:(CGRect)frame I've dropped a view into my window in Interface Builder, set it's class to Box. I am *positive* that the view is my class. Whe

Re: What's wrong with my NSMutableArray?

2009-06-12 Thread Allan Greenier
Thanks Devon. On Jun 12, 2009, at 10:46 AM, Devon Ferns wrote: You need to retain your array since arrayWithCapacity returns an autoreleased object. And in dealloc, release the array, and set to nil if you want to but not necessary. Devon ___

What's wrong with my NSMutableArray

2009-06-12 Thread Allan Greenier
This is so simple I know the answer will embarrass me. I've got an NSMutable array declared in my EAGLview.h file NSMutableArray *boxes; I init and fill it in the EAGLview's initWithCoder method boxes = [NSMutableArray arrayWithCapacity:NUM_BOXES]; for(i

What's wrong with my NSMutableArray?

2009-06-12 Thread Allan Greenier
This is so simple I know the answer will embarrass me. This is an iPhone app. I've got an NSMutable array declared in my EAGLview.h file NSMutableArray *boxes; I init and fill it in the EAGLview's initWithCoder method boxes = [NSMutableArray arrayWithCapacity:NUM_BOXES];

Contextual menu on an NSTableView

2008-05-23 Thread Allan Greenier
I've got some working code that puts up a Contextual menu on my own NSView subclass. Works like a charm. When I try to call setMenu on a NSTableView using the same menu, I crash. How do I put up a contextual menu on an NSTableView? Thanks, Allan ___

Re: NSDictionary from .plist file in Bundle

2008-05-21 Thread Allan Greenier
I remembered that one. :-) I want to load my own .plist - myFile.plist into a dictionary. On May 21, 2008, at 9:01 AM, Ronald Oussoren wrote: from Foundation import NSBundle print NSBundle.mainBundle().infoDictionary() Ronald On Wednesday, May 21, 2008, at 01:42PM, "Allan Gre

NSDictionary from .plist file in Bundle

2008-05-21 Thread Allan Greenier
I have a vague memory that I can swoop up my own .plist in my main bundle into an NSDictionary with one call, but I can't seem to find that call right now. I've looked at the NSBundle and NSDictionary api's to no avail. Can someone her please spark my memory? Thanks, Allan

Re: Cocoa Programming for Mac OS X 3rd ed Shipping?

2008-05-15 Thread allan greenier
Amazon tells me the book is shipped and on it's way to me. ___ 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/Un

Getting line numbers from an NSString

2008-04-11 Thread allan greenier
Greetings, Have I missed this somewhere in the Cocoa - Foundation api? If I have an NSString that is multi lined (say in contains "\n" characters) is there an api call so I can get line 0, line 1, ect? Or should I just code that myself? Thanks, Allan ___