内存泄漏问题.仪器显示第2行有错误


NSArray *arrAllAttributes = [[NSArray alloc]init];
arrAllAttributes = [app mtdAllCountry];
[arrAllAttributes retain];
for(int i = 0; i<[arrAllAttributes count]; i++)
{
    NSDictionary *dictTemp1 = [[NSDictionary alloc]init];
    NSString *strCountryName;
    NSString *strCountryValue;
    dictTemp1 = [arrAllAttributes objectAtIndex:i];
    strCountryName = [dictTemp1 objectForKey:@"country"];
    strCountryValue = [dictTemp1 objectForKey:@"country_ID"];
    [dictTemp1 retain];
    [arrCountries addObject:strCountryName];
    [arrCountryValues addObject:strCountryValue];
}

修改以下行:

NSArray *arrAllAttributes = [[NSArray alloc]init];
arrAllAttributes = [app mtdAllCountry];
[arrAllAttributes retain];

:

NSArray *arrAllAttributes = [[app mtdAllCountry] retain];

相关内容

  • 没有找到相关文章

最新更新