This is the source Download http://115.com/file/bem7sotp # OpenFlow.zip
Enclose part of the code (The following is a synchronous network access pictures) If any expert know how to solve, and has resolved not upload attachments, send mail to me 1217961412@qq.com attach csdn account, I will give points, thank you
- (Void) initAnimals {
NSMutableArray * imageArrays = [[NSMutableArray alloc] init];
[ImageArrays addObject: @ "http://pic5.nipic.com/20100303/3327103_203506956266_2.jpg"];
[ImageArrays addObject: @ "http://cms.smu.sh.cn:888/imagesStore/mmLib/superstar/2009/11/23/07BA1B0C79B146AA9AF32C10F2A5BCD2.jpg"];
[ImageArrays addObject: @ "http://img.daqi.com/upload/slidepic/2009-09-18/156_1253280597_2696737.jpg"];
[ImageArrays addObject: @ "http://365jia.cn/uploads/11/0212/4d5694b592489.jpg"];
[ImageArrays addObject: @ "http://www.erenwu.com/upfiles/allimg/1107/101Z2L62-1.jpg"];
for (int i = 0; i <[imageArrays count]; i + +) {
NSString * path = [imageArrays objectAtIndex: i];
NSURL * url = [NSURL URLWithString: path];
NSData * imageData = [NSData dataWithContentsOfURL: url];
UIImage * image = [UIImage imageWithData: imageData];
CGSize size = CGSizeMake (179, 208);
[ImageArray addObject: [self resizeImage: image scaledToSize: size]];
}
}
Reply:
The UIImage * image = [UIImage imageWithData: imageData]; into a new thread where you can not block ui
Or use sdwebimage, so good
Reply:
Not quite understand the meaning of the landlord, is to use asynchronous load images, or asynchronous load images a problem
If the words of the online asynchronous loading many examples
If asynchronous loading problem is to set up a dictionary of words and pictures and OpenFlow card is loaded in correspondence
Loaded only once a card picture
Reply:
If I were to load ten thousand pictures?
No comments:
Post a Comment