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 because you're over-releasing somewhere else. Then the extra retain is hiding the symptom of the over-release bug.


Regarding the rest of your code, is it possible for -drawRect to be called before readFromData has been called and returned? I note this in particular because drawRect is basically a callback rather than something you directly invoke.

Is MyDocumentView being added to a view hierarchy before readFromData has been invoked?

And is there a reason readFromData isn't a method of MyDocumentView? It seems odd to be manipulating another object's ivars directly from some other class.

  -- GG

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to