4

I have a project in which I put a UIButton on a screen and changed its custom class to PKAddPassButton using XCode (Interface builder) The documentation of this class said that

NS_CLASS_AVAILABLE_IOS(9_0) @interface PKAddPassButton : UIButton

which means that it's available on iOS 9 upward. But the app crashes every time I ran it on iOS 9 (real devices and simulators) with error message

This coder requires that replaced objects be returned from initWithCoder:

When I ran it on iOS 10, it works fine, the button showed up.

Did anyone experience the same thing and found a solution?

Update: The button works fine if it is created programmatically in the code

L N
  • 2,856
  • 4
  • 20
  • 30

1 Answers1

4

You need to instantiate it programmatically instead. That's what I did and it worked for me.

Miroslav Kuťák
  • 1,875
  • 1
  • 18
  • 24