Hi, how do I handle memory management for todoUid below? Do I have to
retain or autorelease it?

[...snip...]

      // Get uid to return
      NSString* todoUid = [newTodo uid];

[...snip...]

      return todoUid;
}

you could do:

NSString* todoUid = [[[newTodo uid] retain] autorelease];

YES! Many, many of memory managemt problems are solved with this technique. BTW: You can do the same inside a getter to get rid of thread problems.

Is the performance hit of keeping objects around until the next pool drain (instead of releasing them when you're done with them) insignificant? In other words, should it be a practice to always autorelease with alloc and init (except for loops as previously mentioned)?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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