Images not showing up when architecture set to 64

2019-01-09 10:50发布

For transitioning my app to 64-bit, I changed the Architectures build setting to:

ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";

App is runnig fine except that some of the images are not showing up (blank). Why would it happen? any clues?

3条回答
手持菜刀,她持情操
2楼-- · 2019-01-09 11:29

Answer lies here:

https://devforums.apple.com/message/922989#922989

I found the reason. In a viewController, which was not yet allocated, but included in the app, there was following implemented (in the .m-file above implementation viewController):

@implementation UIImageView (UIScrollView)
- (void)setAlpha:(float)alpha {
..........(no difference if here is some code or not) ...............
  [super setAlpha:alpha];
}
@end

Putting above in comment solved the problem, even though the button which didn't display the image wasn't in a scrollview.

查看更多
▲ chillily
3楼-- · 2019-01-09 11:47

It fixed my issue to change

- (void)setAlpha:(float)alpha {

to:

- (void) setAlpha:(CGFloat)alpha {
查看更多
可以哭但决不认输i
4楼-- · 2019-01-09 11:52

Update the Data structure used in code according to 64 bits for example replace Float with CGFloat,(if not working Than also change int type with NSInteger)
see here for more information
In my case replace Float with CGFloat and solve my problem (simplest way to replace float to CGFloat )

#define float CGFloat

Write in .pch file and check it working or not.
Thanks

查看更多
登录 后发表回答