I'm teaching myself Objective-C 2.0 using Apple's Programming With Objective-C guide.
I have a question regarding what I believe to be implicitly created pointers.
If I were to rewrite the example code:
@implementation XYZShoutingPerson
- (void)saySomething:(NSString *)greeting {
NSString *uppercaseGreeting = [greeting uppercaseString];
[super saySomething:uppercaseGreeting];
}
@end
as
@implementation XYZShoutingPerson
- (void)saySomething:(NSString *)greeting {
[super saySomething:[greeting uppercaseString]];
}
@end
would I be receiving an implicitly created pointer to a new NSString object and if so what would the scope of the pointer be?
Is one approach considered better than the other?