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);
_
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
- (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
> 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
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
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
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
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) {
/