iOSアプリケーションを終了してメモリリークを取り除いているので、 値を割り当てている間に機器がリークしていることがわかりました。NSDictionaryのメモリリークで値を割り当て中
.hファイルでは、プロパティ(nonatomic、retain)でNSdictionaryのfeedDataを宣言しました。
私はNSdictionaryを後退させるもう一つのクラスWebServiceControllerを持っています。
ここに私のコードです。 .mファイルで
if ([nid rangeOfString:@","].location == NSNotFound)
{
NSArray *data = [[NSArray alloc]initWithObjects:nid,[NSNumber numberWithInt:0],[NSNumber numberWithInt:0],delegate1.myCity,nil];
WebServiceController *wsct=[[WebServiceController alloc]init];
wsct.delegate=[[UIApplication sharedApplication]delegate];
feedData=[wsct getTimelineFeed:data];
NSLog(@"feed data is--->%@",feedData);
[wsct release];
}
コード "feedData = [getTimelineFeed wsct:データ];"メモリリークを起こしています。
ここではNSDictionaryを返す関数です。
- (NSDictionaryの*)MyTimelineFeed:(にNSArray *)データ
{
if(![delegate sessionId]) return nil;
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:ENDPOINT]];
NSMutableArray * postParams = [NSMutableArray array];
NSString * method = [NSString stringWithFormat:@"timeline.getFeedItems"];
[postParams addObject:[delegate sessionId] ];
for (int i = 0; i < [data count]; i++) {
[postParams addObject:[data objectAtIndex:i]];
}
[request setMethod:method withObject:postParams];
XMLRPCResponse *nodeSaveResponse = [XMLRPCConnection sendSynchronousXMLRPCRequest:request];
[request release];
if([nodeSaveResponse isKindOfClass:[NSError class]])
return nil;
NSMutableDictionary * dict = [nodeSaveResponse object];
if ([dict isKindOfClass:[NSError class]]) {
//NSLog(@"Error found");
return nil;
}
return dict;
}
PLSヘルプ。
WebServiceControllerは、作成したクラスですか?質問にgetTimelineFeedの実装を含めることができますか? – jrturton
私の編集でこの機能を追加しました。 –