• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: nil there not here
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nil there not here


  • Subject: Re: nil there not here
  • From: Greg Guerin <email@hidden>
  • Date: Mon, 27 Jul 2009 15:17:28 -0700

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@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: [iPhone] Why can't a UITextField be its own delegate?
  • Next by Date: Re: nil there not here More Info
  • Previous by thread: Re: nil there not here
  • Next by thread: Dynamic UI with scroll view
  • Index(es):
    • Date
    • Thread