Runtime error when creating pdf using ObjC

FB13206027 (Crashing on simulator but works fine on real device)

Shows: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) At: [logo drawInRect:CGRectMake( pos - (logoWidth/2), 10, logoWidth, logoWidth)];

  • (void) drawLogoImages { NSArray* signArr = [gDataManager getLogoForOrder:nil]; float logoWidth = 100; float pos = pageSize.width/2; for (NSString* anImageName in signArr) { NSString* path = [[kDocumentDirectoryPath stringByAppendingPathComponent:kLogoFolderName] stringByAppendingPathComponent:anImageName]; UIImage * logo = [UIImage imageWithContentsOfFile:path]; if (logo) { [logo drawInRect:CGRectMake( pos - (logoWidth/2), 10, logoWidth, logoWidth)]; } else { NSLog(@"Error loading image from file: %@", path); } pos += 45; } }

It keep crashing on Xcode15 with simulator however works perfectly fine on real device

Runtime error when creating pdf using ObjC
 
 
Q