iPhone应用程序中的图像显示在模拟器中,但在编译到设备时则不会 [英] Images in iPhone app appear in Simulator, but not when compiled to device

查看:123
本文介绍了iPhone应用程序中的图像显示在模拟器中,但在编译到设备时则不会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习iPhone开发,并且已经构建了一个简单的应用程序,当您点击它时,该应用程序的图像会更改为另一个图像。

I am learning iPhone development, and have built a simple app that has an image that changes to another image when you tap it.

如果我将其构建到模拟器,它工作正常,但如果我建立它的设备图像不会出现。我觉得他们没有被复制过。我已经检查过他们已经正确命名了,我确保将它们导入'资源'

If i build it to the simulator, it works fine, but if i build it to the device the images dont appear. i feel like they aren't being copied across. I have checked they have been named correctly and i have made sure i imported them to 'resources'

我不认为这是代码的问题,因为我添加了一个东西也可以在点击图像时显示文字,这样就可以了,所以按钮仍然在做某事,它上面没有图像。

I dont think it is a problem with the code because i added a thing to also make text appear when the image is tapped, and this works, so a button is still there doing something, it just doesn't have an image on it.

-(IBAction)changeImage:(id)sender { 
[fortuneCookieButton setImage:[UIImage imageNamed:@"Image2.jpg"] forState:UIControlStateNormal]; 
label.hidden = NO; 
}

 -(IBAction)restoreImage:(id)sender { 
[fortuneCookieButton setImage:[UIImage imageNamed:@"Image1.jpg"] forState:UIControlStateNormal]; 
label.hidden = YES; 
}


推荐答案

案例(上/所有文件名都与所有字母完全匹配?源代码和项目& Mac?

Does the case (upper/lower) of all your file names match exactly for all letters? Source code & project & Mac?

这篇关于iPhone应用程序中的图像显示在模拟器中,但在编译到设备时则不会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆