Re: nil there not here

2009-07-28 Thread David Duncan
On Jul 27, 2009, at 2:44 PM, David Blanton wrote: context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx, bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host); CGImageRelease(_myDocumentView->_cgImageRef); _

Re: nil there not here

2009-07-27 Thread Kyle Sluder
On Mon, Jul 27, 2009 at 3:56 PM, David Blanton wrote: > What is the preferred method of associating a view with a document?  This is > the fundamental issue for me. It's known as the Model-View-Controller paradigm. Typically you create some custom class known as a controller, which mediates betwe

Re: nil there not here

2009-07-27 Thread David Blanton
- (BOOL)readFromData:(NSData*)data ofType:(NSString*)typeName error: (NSError*)outError { return [_myDocumentView setImageFromData:data type:typeName error:outError]; } Yes, I should do it as above and will. Thanks for the suggestion. I guess a better way of stating the problem is : Wh

Re: nil there not here More Info

2009-07-27 Thread Scott Ribe
> I just noticed that the object I allocate is not the one whose > drawRect is being called ... I am confused ... what other object is > there ! One defined in a nib file perhaps? -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: nil there not here

2009-07-27 Thread Dave Carrigan
On Jul 27, 2009, at 2:44 PM, David Blanton wrote: _myDocumentView = [[MyDocumentView alloc] init]; [_myDocumentView retain]; You already own _myDocumentView by virtue of the fact that you used alloc/init, so this extra retain is going to lead to memory leaks

Re: nil there not here More Info

2009-07-27 Thread David Blanton
I just noticed that the object I allocate is not the one whose drawRect is being called ... I am confused ... what other object is there ! On Jul 27, 2009, at 3:44 PM, David Blanton wrote: I create a CGImageRef and store it When I get around to using it, it is nil My code is below ... fire

Re: nil there not here

2009-07-27 Thread Greg Guerin
David Blanton wrote: _myDocumentView = [[MyDocumentView alloc] init]; [_myDocumentView retain]; This is over-retaining _myDocumentView. You called alloc/init, so you already own the instance. If you retain it again, you're not gaining anything. Unless you're doing the extra retain becau

nil there not here

2009-07-27 Thread David Blanton
I create a CGImageRef and store it When I get around to using it, it is nil My code is below ... fire away, please! #import "MyDocumentView.h" @interface MyDocument : NSDocument { MyDocumentView* _myDocumentView; } @end - (id)init { self = [super init]; if (self) { /