Can an NSString be reused like this:
NSString *string = @"first value";
NSLog(string);
string = @"second value";
NSLog(string);
This works when tested, but is it proper coding?
Thanks.
Can an NSString be reused like this:
NSString *string = @"first value";
NSLog(string);
string = @"second value";
NSLog(string);
This works when tested, but is it proper coding?
Thanks.
Yes, your example is totally fine. What is your concern about it being 'improper'?
Edit: Strictly speaking it is probably safer to use:
NSLog(@"%@", string);
Instead of just logging the string directly. I don't think that's what you were asking, though.