1

我已经建立了与服务器的连接,现在我想将图像传输到 iPhone。最好的方法是什么?我在这里检查过,我没有看到除了 xml 之外的任何传输方式。我需要图像。谢谢你!

4

1 回答 1

6

这是将图像从网络传输到 iphone 的示例:

id path = @"http://a1.twimg.com/profile_images/65821548/summer2007_normal.jpg";
            NSURL *url = [NSURL URLWithString:path];
            NSData *data = [NSData dataWithContentsOfURL:url];
            UIImage *img = [[UIImage alloc] initWithData:data ];
于 2009-09-09T02:00:02.007 回答