Я получаю утечку памяти с этим кодом iPhone 3.0 SDK.
Я использую JSON из http://code.google.com/p/json-framework/
Вот мой код:
// .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;
Если возможно, пожалуйста, объясните больше об этой форме управления памятью. Я хорошо знаком с retain / release, но, очевидно, у меня возникают проблемы с его реализацией
Спасибо!