UIImageView.image 适用于 iPhone 5/ios7,但不适用于 iPhone 4/ios 5



所以我让用户登录到Facebook,然后将他们的fb照片保存到我的应用程序中。这在我的iPhone 5和iOS 7上完美运行,但我只是想看看较小的屏幕看起来如何,所以我拿出了带有iOS 4的iPhone 5。还没有尝试过 iOS 6。我对 Objective c/xcode 非常陌生,并开始开发 xcode 5 beta 和 iOS 7。对于版本 <7,我需要做一些不同的事情

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    // As chuncks of the image are received, we build our data file
    [imageData appendData:data];
}
// Called when the entire image is finished downloading
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    // Set the image in the header imageView
    profilePic.image = [UIImage imageWithData:imageData];
    NSLog(@"%@",profilePic.image);
}

编辑:

imageData 具有数据和 profilePic.image 使用 NSLog 返回一个 uiimage

另外,我需要在 5 之前为 iPhone 制作一个新的故事板吗?

在每个版本的iOS中,通常会有相当多的变化,在特定版本中运行的应用程序在另一个版本中中断的情况并不少见。

我的建议是,您浏览版本 6 和 7 的 Apple 发行说明,并检查是否有适用于 iOS 7 而不是 iOS 5 的内容。

顺便说一句,您是否出于特定原因在iPhone 5中有iOS 4?

我的

猜测是,应该没有那么多用户使用这样的旧版本,我将我的升级到iOS7,我想绝大多数没有这样做的人至少会拥有版本6。

最新更新