FROM : Chris Paveglio
DATE : Thu Jul 03 20:57:33 2008
My code is like this:
NSMutableString *theSettings;
theSettings = [[NSMutableString alloc] init];
//myPrefs is an array of strings, each item is like "Library/Safari"
int i;
for (i = 0; i < 8; i++
{
theSettings = [NSHomeDirectory() stringByAppendingPathComponent:[myPrefs objectAtIndex:i]];
....
}
Thinking about it, do I need the alloc and init commands? Sometimes I am unsure about what needs alloc or init versus what I can just declare as a variable without doing that.
Thanks for your help!
Chris
DATE : Thu Jul 03 20:57:33 2008
My code is like this:
NSMutableString *theSettings;
theSettings = [[NSMutableString alloc] init];
//myPrefs is an array of strings, each item is like "Library/Safari"
int i;
for (i = 0; i < 8; i++
{
theSettings = [NSHomeDirectory() stringByAppendingPathComponent:[myPrefs objectAtIndex:i]];
....
}
Thinking about it, do I need the alloc and init commands? Sometimes I am unsure about what needs alloc or init versus what I can just declare as a variable without doing that.
Thanks for your help!
Chris






Cocoa mail archive

