I’m using this code to stretch an image correctly, however on iOS 5.1 it crashes.
If I remove the resizingMode from the end, it works but the image is then tiled and looks funny.
Any ideas why it’s crashing?
Thanks
self.scrollViewImage.image = [[UIImage imageNamed:@"SysInfoBackBox"] resizableImageWithCapInsets:UIEdgeInsetsMake(40, 40, 40, 40) resizingMode:UIImageResizingModeStretch];
It’s a new method introduced in iOS 6.0 and not supported on previous versions. If you want to make the code run on previous versions, you will have to check at runtime if UIImage instance responds to selector for that method and implement alternative if it doesn’t.