Quote:
Originally Posted by DenVog
In the following example, should you release versionCombined because that is the string that is initially allocated, or versionLabel since that's what the string is ultimately assigned to?
Code:
- (void) versionLabel {
NSString *versionShort = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
NSString *versionCombined = [[NSString alloc] initWithFormat:@"%@ (%@)", versionShort, version];
versionLabel.text = versionCombined;
}
Thanks for clarifying.
|
In this code, you are responsible only for "versionCombined", because you are alloc/init-ing it.