News for hackers. Stuff that matters.
Re:iPhone development emergency guide by tumult on Wednesday July 22, 2009 @08:51AM (#717765)
Well, on iPhone, it would get deallocated with the next pool drain, not garbage collected (since garbage collection does not exist for iPhone as of now.)

foo = myshinyobject is ok if you use instantiate it like [[SomeClassThing alloc] initetc] rather than one of the convenience methods like [SomeClassThing thing] since those are supposed to be returned with a retain count of 0.

I forgot what I was getting at.

Re:iPhone development emergency guide by einarvollset on Wednesday July 22, 2009 @11:22AM (#717989)
Well, sort of.

If you do an alloc/init, then you need to release it (or you leak). If you're assigning to self.foo, then you can just release the thing you created after assigning it. If you assigned it to foo, and then release it, then you're in the position I mentioned above.