6

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?

Firdous
  • 4,624
  • 13
  • 41
  • 80
  • So only when running in 64 bit do the images fail to appear? Or now some images never appear? Simulator or device or both? We need more info update the question please. – David H Dec 31 '13 at 15:21
  • yes only running on a 64 bit device (simulator or iphone 5s) some images never appear on any run, and works perfect on 32 bit device (simulator or device). – Firdous Jan 01 '14 at 07:37
  • ive observed that most of those failed images include whose view was built using xib layout and image assigned through code, others include those that were custom images on uibarbuttonitems – Firdous Jan 01 '14 at 07:57
  • Post a demo project with one such image on Dropbox. My guess at this point is that the image decoding code in ios may be the issue, along with a possibly improperly coded image. For jpgs, ios uses the integral array processor and that code is quite complex. – David H Jan 01 '14 at 13:23
  • fixed that, see answer – Firdous Jan 06 '14 at 06:19
  • hi @Firdous i have same problems this solution not work for me all the working fine in iphone 5 but in iphone 6 device and simulator not display button images and `imageview `images. please give me any solution . Thanks in advanced. – Ilesh P Mar 20 '15 at 12:21
  • @Ilesh r u sure you dont have any imageview category in directory – Firdous Mar 20 '15 at 13:25
  • yaa @Firdous please give me a any solution ... – Ilesh P Mar 20 '15 at 13:33
  • @DavidH any comments.. – Firdous Mar 23 '15 at 12:33
  • @Ilesh one of you needs to post a demo project with at least one image that does not load. Throw in a bounty for good measure! – David H Mar 23 '15 at 14:31
  • i was unable to repro the issue in a demo project, since it was only caused by this category, @Ilesh might want to share – Firdous Mar 24 '15 at 10:05
  • Hi guys , My problems solve through replace `float` to change `CGFloat` in project . Thank you guys for rpl – Ilesh P Mar 25 '15 at 05:55

3 Answers3

13

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.

Firdous
  • 4,624
  • 13
  • 41
  • 80
  • 2
    Thanks a lot! This saved me a lot of time tracking down the issue. Apparently, we also had a similar category. – bluebamboo Feb 18 '14 at 17:30
  • 1
    I'm guessing the category came from here: http://stackoverflow.com/a/8607393/123269 – Reed Olsen Mar 26 '14 at 21:50
  • 1
    Note that 'alpha' is a CGFloat, which is a float on 32 bit systems and a double on 64 bit systems. The above category declares it as a float in all cases. – David H Mar 23 '15 at 14:33
4

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

Community
  • 1
  • 1
Ilesh P
  • 3,940
  • 1
  • 24
  • 49
3

It fixed my issue to change

- (void)setAlpha:(float)alpha {

to:

- (void) setAlpha:(CGFloat)alpha {
josliber
  • 43,891
  • 12
  • 98
  • 133