나는 objective-c 문제가있다. MSMutableArray에 UIImage를 어떻게 추가합니까? 다음은 가지고있는 코드입니다.Objective-C에서 MSMutableArray에 UIImage를 어떻게 추가합니까?
MSMutableArray *arr = [[NSMutableArray alloc] init];
UIImage *image;
UIGraphicsBeginImageContext(contextSize);
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, 0, pushUpSize);
[screenWindow.layer renderInContext: context];
image = UIGraphicsGetImageFromCurrentImageContext();
}
UIGraphicsEndImageContext();
[arr addObject:image];
그러나 이미지를 추가하려고하면 프로그램이 충돌합니다. 나는 포인터가 아닌 변수를 추가하는 것이 어딘가에있는 것을 읽었다. UIImage를 배열에 추가하려면 어떻게해야합니까?
감사합니다.
충돌이 발생했을 때 로그에 표시되는 내용은 무엇입니까? 우리가 이것을 더 잘 도울 수 있도록 게시 해주십시오. –