Reputation: 87
NSString * str1 = nil;
NSString * str2 = nil;
str1 = @"";
str2 = @"";
I got memory warning "Value stored to 'str1' is never read" on above statement. Is there any other way to do the same?
Upvotes: 1
Views: 552
Reputation: 881423
The warning:
Value stored to 'str1' is never read
is simply telling you that you have a variable which you set and never use. You'll see the same sort of thing with:
static void xyzzy (void) {
int plugh = 7;
}
where clearly the plugh
variable is not being used.
That's not a serious problem (otherwise it would be an error rather than a warning) but it does notify you that either:
One example of the latter is if you are accidentally using str2
somewhere where you intended to use str1
(possibly due to a cut-and-paste where you forgot to change the pasted code).
As to how to fix it:
Upvotes: 7