开发者

Memory leak issue. Instument shows error in line 2

开发者 https://www.devze.com 2023-02-22 10:39 出处:网络
NSArray *arrAllAttributes = [[NSArray alloc]init]; arrAllAttributes = [app mtdAllCountry]; [arrAllAttributes retain];
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

精彩评论

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