I am developing a plugin for an iOS application. I am compiling it into a .a file which is then used by the main xcode project.
So far I have create a category of the UIDevice class in this library. When I run the main project using this library it crashes due to an unrecognized selector
-[UIDevice platform]: unrecognized selector sent to instance
platform is one of the fuinctions I added via the category.
So I thought it wasn't linking those functions at all and added a c function to the same file as the UIDevice category then called it from my code .
This time the main project ran fine... So I thought maybe it was something else i did and removed the C function. But lo and behold it crashed again due to unrecognized selector..
My questions:
Why does xcode ignore the category definition unless I call a function declared in the same file?
Is there an xcode setting i can change to make it include these methods from the UIDevice category regardless of whether I call a function from that file or not?
cheers
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…