0

I have been working on an app, and wrote a lot of category methods on classes like NSNumber.

I now want to turn this into a Unity plugin. The code is now failing in this context, with -[__NSCFNumber int32Value]: unrecognized selector.

I have tried the -ObjC flag (OTHER_LDFLAGS) but that doesn’t seem to matter (I can’t add it when building the game engine).

I’ve looked at Objective-C categories in static library but don’t see anything that addresses this from the context of code in a plugin calling category methods it defines. Am I missing something?

David Dunham
  • 8,139
  • 3
  • 28
  • 41
  • This must be a linking problem, it's hard to say without knowing more. – Sulthan Mar 08 '18 at 18:58
  • What else do you need to know? The plugin runs fine until it gets to a self-defined category method. I do link with the flag that is supposed to deal with this, but I can’t tell if this has to be used on the host application or the plugin itself. – David Dunham Mar 08 '18 at 19:32
  • Are other methods from the static lib called correctly? Or does it affect only the categories? – Sulthan Mar 08 '18 at 19:39
  • Yes, it gets pretty deep into the code before it hits a category. – David Dunham Mar 08 '18 at 19:56

1 Answers1

0

Yes. I had seen a comment elsewhere on StackOverflow that you could not. But the real problem was that I had a build error, and the category in question was not in fact linked.

David Dunham
  • 8,139
  • 3
  • 28
  • 41