Я сделал то же самое в Mac, возможно, вы могли бы попробовать это,
+(NSImage *)BreakImageForFirstImage:(NSImage *)pSrcImage Size:(NSSize)imageSize{
/*
Create a new NSImage with the size of the subrect, lock focus on it, draw the sub rect of the source image into
the new, locked image using -drawInRect:fromRect:operation:fraction: ("fromRect:" should be the subrect of the
source; the first rect argument will be a rect of the same size as the subrect, with a 0,0 origin), then unlock
focus from the new image. Done. Because of all that's involved in this, it might still be more efficient just to
load individual images
*/
NSSize srcSize = [pSrcImage size];
int subImageHeight = imageSize.height;
int subImageWidth = imageSize.width;
NSRect subImageRect = NSMakeRect(0,0,imageSize.width,imageSize.height);
NSRect tempRect = NSMakeRect(0,0,imageSize.width,imageSize.height);
//NSMutableArray *pImageArray = [[NSMutableArray alloc]initWithCapacity:noOfImages];
NSImage *pTempImage = nil;
int rowId =0;
int colId = 0;
//for(;rowId<noOfRow;rowId++)
{
pTempImage = [[NSImage alloc]initWithSize:imageSize];
tempRect = NSMakeRect(rowId*subImageWidth,colId*subImageHeight,subImageWidth,subImageHeight);
[pTempImage lockFocus];
[pSrcImage drawInRect:subImageRect fromRect:tempRect operation:NSCompositeSourceOver fraction:1.0];
[pTempImage unlockFocus];
//[pImageArray insertObject:pTempImage atIndex:rowId];
}
return pTempImage;
/* */
}
Возможно, в некоторых местах вам может понадобиться преобразовать NS в UI, чтобы он работал для iOS