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.

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];

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];

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

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 ___

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: 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 Greenier [EMAIL