开发者

Memory leak issue. Instument shows error in line 2

NSArray *arrAllAttributes = [[NSArray alloc]init];
arrAllAttributes = [app mtdAllCountry];
[arrAllAttributes retain];
for(int i = 0; i<[arrAllAttributes count]; i+开发者_如何学JAVA+)
{
    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];
}


Change these lines:

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

To this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜