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:
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]];
Complete the piece with sdwebimage ~ ~
No comments:
Post a Comment