[英]UIButton setImage: forState not working with 64 bit architecture
I have existing project created a year ago. 我有一年前创建的现有项目。 After AppStore's 64 bit requirement announcements, I had to include
arm64
architecture into my project 在AppStore的64位需求公告之后,我不得不将
arm64
架构包含在我的项目中
But after adding arm64
into appTarget -> Build Settings -> Valid Architectures
all the setImage: forState
methods of all UIButton
objects stopped working, while setBackGroundImage: forState
is working normally. 但是在将
arm64
添加到appTarget -> Build Settings -> Valid Architectures
,所有UIButton
对象的setImage: forState
方法都停止工作,而setBackGroundImage: forState
正常工作。
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
[button setImage:image forState:UIControlStateNormal];
To test this oddity I created new project and created UIButton
and used setImage: forState
method, everything is working as expected. 为了测试这种奇怪,我创建了新项目并创建了
UIButton
并使用了setImage: forState
方法,一切都按预期工作。
If I remove back arm64
architecture, every thing is ok with my project. 如果我删除了
arm64
架构,那么我的项目就可以了。 I don't know what I did wrong with my project. 我不知道我的项目做错了什么。
你应该使用UIControlState tydef而不是int [1]
[button setImage:image forState:UIControlStateNormal]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.