UIImageView initWithCoder - unrecognized selector sent to instance… iOS 5 beta SDK

后端 未结 3 1012
情书的邮戳
情书的邮戳 2021-01-24 06:43

I\'m sorry if it has already been asked, but here comes the problem:

I\'ve recently updated my SDK to iOS 5 beta. My app builds and runs perfectly fine

相关标签:
3条回答
  • 2021-01-24 06:46

    I can't open URL https://devforums.apple.com/message/507796#507796.... but I think you can make a category for UIImage class, like this:

    @implementation UIImage (Coder)
    
    - (id)initWithCoder:(NSCoder *)aCoder
    {
         return nil;
    }
    
    @end
    
    0 讨论(0)
  • 2021-01-24 06:48

    I had the same problem and just found a solution. My UIActivityIndicator was added into a xib file. I have removed it from the xib and have created it by code (activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:...).

    All is ok now, it works !

    I hope this will helps you.

    0 讨论(0)
  • 2021-01-24 06:56

    Following smith324's advice I started to browse Apple dev forums to find out if I'm doing something wrong or if there's a bug in the SDK. It turns out, that there's a nasty bug in the latest release crashing UIImages, UIActivityIndicators etc. just like in my case. Good news is, there actually is a workaround and you can find it here: https://devforums.apple.com/message/507796#507796

    Thanks everyone for your help!

    EDIT:

    If you can't access the link, this is the suggested answer:

    @implementation UIImage (initWithCoder)
    
    - (id)initWithCoder:(NSCoder *)aDecoder
    {
         return nil;
    }
    
    @end
    
    0 讨论(0)
提交回复
热议问题