In my app i get a memory leak in
first
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
result = [[NSString alloc] initWithBytes:[webData mutableBytes]
length:[webData length]
encoding:NSUTF8StringEncoding];
[webData release];
}
second
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSString * result = [[NSString alloc] initWithBytes:[webData mutableBytes]
length:[webData length]
encoding:NSUTF8StringEncoding];
[webData release];
}
in my first process I didn't get a memory leak(Declare a string object globally and I didn't release it)
In my second process i get a memory leak in string object.
Value stored to 'result' during its initialization is never read
Method returns an Objective-C object with a +1 retain count (owning reference)
Object allocated on line 124 and stored into 'result' is no longer referenced after this point and has a retain count of +1 (object leaked)
what is the difference?