我有一个应用程序,我在其中显示大约 50 张图像,当我达到第 30 张图像时,我的应用程序由于内存问题而崩溃。我已经尝试了所有我知道的方法,但仍然没有解决问题。所以请帮助我。
NSLog(@"%d",nn);
nn ++;
NSLog(@"%d",nn);
NSMutableArray* arr2 = [[NSMutableArray alloc]init];
arr2 = [Database executeQuery:@"select * from cartoon"];
if (nn == [arr2 count])
{
nn = 0;
}
NSMutableDictionary* dict1 = [arr2 objectAtIndex:nn];
NSLog(@"%@",dict1);
NSString * both_name = [NSString string];
both_name = [both_name stringByAppendingString:[dict1 objectForKey:@"mainpk"]];
both_name = [both_name stringByAppendingFormat:@". "];
both_name = [both_name stringByAppendingString:[dict1 objectForKey:@"name"]];
NSLog(@"both %@",both_name);
label1.text = both_name;
imgv.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.jpg",[dict1 objectForKey:@"name"]]]; `