On May 11, 2009, at 10:15 PM, jon wrote:
my wild guess right now is to do this below when ever i have the "NSString" instance assignment to prevent, for instance, "theTitle" from "randomly disappearing"...

I hope the following doesn't sound harsh, because I'm not trying to be...

I'd second Clark's advice to read the docs on memory management, and come back with specific questions if you have any. And I'd add that "randomly disappearing" is almost meaningless and gives us nothing to go on. What specific behavior did you see? Was there a crash, and if so, on what line of code? Did the variable mysteriously become nil, and if so, how do you know -- did you use the debugger, did you use an NSLog statement, did a text field suddenly go blank? How random is random? Is it 100% reproducible? Can you narrow it to a line of code?

ok, tell me how badly this will go wrong... (although this would be more like "theTitle" is declared in an area that is global, and then assigned later.)

I do know that "NSSTring" is "different" than other objects,

What do you mean by this?  How do you know this?

Again, this is meant to help. You'll get better results if you ask precise questions with actual code rather than paraphrases. Your chances of getting a problem diagnosed are much better when people understand the problem clearly.

--Andy

but i'm not sure how, they do appear to act like other objects though as far as i can tell.
thanks in advance,
Jon.

NSString *theTitle = [[defaults stringForKey:@"the title"] retain];

_______________________________________________

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 arch...@mail-archive.com

Reply via email to