I'm getting an instruments Memory Leak with this iPhone 3.0 SDK code.
I'm using the JSON from http://code.google.com/p/json-framework/
Here is my code:
// .h
@property (nontatomic,retain) NSMutableArray *tweets;
// .m
import" JSON.h"
@synthesize tweets;
...
tweets = [[NSMutableArray alloc] init];
NSURL *url = [NSURL URLWithString:@"http://www.someurl.com"];
NSString *jsonString = [NSString stringWithContentsOfURL:url];
NSArray *results = [jsonString JSONValue];
NSArray *data = [results valueForKey:@"stories"];
for(NSDictionary *tweet in data) {
TweetmemeData *tweetmeme = [[TweetmemeData alloc] initWithTweet:tweet];
[tweets addObject:tweetmeme];
[self debugDump:tweetmeme];
[tweetmeme release];
}
[results release];
return tweets;
If possible, please explain more about this form of memory management. I'm very familiar with retain/release but obviously am having trouble implementing it :)
Thanks!