from my very limited Objective-C programing experience of all of 10 days...

it appears to me that my assignments to NSStrings seem to, at random, disappear..... (i, being a new Objective-C programmer coming from pascal and C, like to have a "global" string in several places, not that it is correct or anything, but i still would like to know what is going on when i do keep a string around for a good long time in the application) (or any other object for that matter)

I attribute it so far to my lack of understanding garbage collection and retaining objects...

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"...

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, 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 ([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