0

Here is thing, I am developing a framework for other companies to use. If my framework and other companies both implement a class "ABC" and class "ABC" in framework is private framework class it wound cause naming conflict warning during runtime:

objc[1326]: Class ABC is implemented in both Some.framework/Some and heTEST.app/heTEST. One of the two will be used. Which one is undefined.

According to the warning, one of the class will be ignored. However, I did a little research and find out both class will be loaded and will not cause problem (Since class ABC in framework is private, any code outside will not be able to retrieve it. The class ABC used outside is the class defined outside by #import "ABC.h")

My questions are:

Shall I ignore this warning or how to avoid?

ps, I am tired of renaming class in framework because my framework is using several open source library(i.e AFNetworking)

Hayley Guillou
  • 3,953
  • 4
  • 24
  • 34
tzx7788
  • 37
  • 4
  • This is what namespaces are for. Surely Objective C has them? Declare your classes in your own namespace, and if there's a conflict, the user can just refer to them explicitly with the fully-qualified name, or import only the namespace he wants, or use aliases. – Robert Harvey Jul 13 '15 at 01:29
  • @Robert Harvey, unfortunately, Objective C does not have namespaces but module was introduced in swift which is considerably to be the namespaces. I am studying modules from llvm these day and have no clue to find a solution – tzx7788 Jul 13 '15 at 01:34
  • Then I think you'll need to add a prefix to all of your method names (the initials of the library, perhaps). That said, have a look at http://stackoverflow.com/a/180674 – Robert Harvey Jul 13 '15 at 01:36
  • @Robert Harvey, Thanks, that's exactly what I want to know! – tzx7788 Jul 13 '15 at 02:12

0 Answers0