Objective-C Category in iOS Module

You must Login before you can answer or comment on any questions.

I am using a category on a UIKit class (UIImage) in a module and getting an unrecognized selector error (for one of the selectors in the category).

  1. Are Objective-C categories supported?
  2. Is there anything special that needs to be done to get the category included?
— asked 3 years ago by Gerry Cardinal III
1 Comment
  • As a workaround, I rewrote the code without the use of Objective-C categories. However, I would like to know how to get categories to work in modules OR to request that category support be added to modules.

    — commented 3 years ago by Gerry Cardinal III

2 Answers

add linker option -ObjC or -all_load to module.xcconfig.

http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library

I noticed I had to include the external libraries and any special frameworks also in your Titanium xcode project. I was getting the unrecognized selector too.. Just add the frameworks, and in your main.m import any headers you are using.

— answered 3 years ago by Daniel Tome
answer permalink
1 Comment
  • Actually this issue is specific to Objective-C categories. It works fine without the categories. I am importing headers into the appropriate .m files where they are used and including the frameworks in my module.xcconfig file.

    — commented 3 years ago by Gerry Cardinal III

Your Answer

Think you can help? Login to answer this question!