this is part of my code:
NSMutableArray oldWordsArray;
newWordsArray= [self getNewWordArray];
-(NSMutableArray *) getOldWordArray{
NSString *user_id = (NSString*)[tool readObkect:@"user_id"];
NSMutableArray oldWords = [[NSMutableArray alloc]init];
oldWords = [database getOldWord:user_id];
NSLog(@"从所有词库中得到新单词");
return oldWords;
}`
So: how should I release Variable oldWordsArray and oldWords, many thanks!
I am guessing, that you are not using ARC. This:
Can be translated into this:
And then:
I am not sure what the
databaseis, but it should return anautoreleasedobject, so you don't have toreleaseit yourself, in that context. You should as well, not use the prefixgetingetOldWord. You can as well, use anNSArrayinstead of aNSMutableArray.