これは drawRect 内にあります。
NSString *generated = [Entry generateString];
const char *cString = (const char*)[generated UTF8String];
dispatch_queue_t queue = dispatch_queue_create(cString, NULL);*/
dispatch_async(queue, ^{
Media *media = [self.entry.media objectAtIndex:i];
UIImage *image = [media getThumbnail];
dispatch_async(dispatch_get_main_queue(), ^{
int bottom = [JHomeViewCell yOfMessageBottomWithMessageHeight:self.cellInfo.messageHeight
withMonth:self.cellInfo.hasMonth];
CGRect frame = CGRectMake(87 + (68 * i),
bottom,
THUMBNAIL_SIZE.width,
THUMBNAIL_SIZE.height);
[image drawInRect:frame];
});
});
現在、objectAtIndex 行でクラッシュしています。無効なインデックスではありません。コードはここ以外では正常に動作します。
編集:このエラーが発生しました:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'statement is still active'
編集 2: 最初に media.count を取得する NSLogs を入れました。同じエラーでクラッシュしました。