I have lunched the Static analyzer in my app and i have some warnings (errors) and i don’t know how to avoid theme, the warnings are :
Dead store ....
the code line is :
NSArray *listHighlights = [NSArray array];
listHighlights = [jsonParser objectWithString:highlightText error:&error];
....
I think that i can do like this, but the object listHighlights is not allocate ??
NSArray *listHighlights = [jsonParser objectWithString:highlightText error:&error];
This…
…makes your variable point to an autoreleased array, and you then immediately overwrite the address of that object with whatever is returned from
objectWithString:…presumably another array that it has created. Because of the autorelease, it’s not actually a leak but it’s certainly a waste of effort.