저는 약 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 개의 이미지를로드하지 마십시오)? –
내 대답을 확인하십시오 : http://stackoverflow.com/questions/11758454/need-to-create-photo-slider-using-photo-library-photos-in-iphone/11760226#11760226 도움이 될 수도 있습니다. – Iducool
내 대답 확인 : [http://stackoverflow.com/a/11791089/1132951] (http://stackoverflow.com/a/11791089/1132951) 도움이 될 수 있습니다. –