我有應用程序,其中我顯示大約50圖像,當我達到第30圖像我的應用程序崩潰,由於內存問題。我嘗試了所有我知道的方法,但仍然沒有解決問題。所以請幫助我。應用程序崩潰由於uiimageview
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"]]]; `
這段代碼與這個問題有什麼關係?除顯而易見外(即:如果30張圖像不適合記憶,不要加載30張圖像),您尋找什麼樣的幫助? – 2012-08-03 11:40:11
檢查我的答案:http://stackoverflow.com/questions/11758454/need-to-create-photo-slider-using-photo-library-photos-in-iphone/11760226#11760226可能會幫助你。 – Iducool 2012-08-03 11:57:42
檢查我的答案:[http://stackoverflow.com/a/11791089/1132951](http://stackoverflow.com/a/11791089/1132951)這可能會有所幫助 – 2012-08-03 12:06:30