Friday 15 July 2011

objective c - iOS framework and Category import -


I just started preparing my own structure to rejoin some helpful helpers, celebrations, tools, etc. is. Everything is fine, I was just wondering if it is possible to import my categories directly into my main header framework file.

For example, my structure has been named myFramamework. I have written all my imports: In the public headers, a class name is named myFramework.h:

  #import "MyCategory + Helper.h" #import "MyOthercategory + Helper.h" #import "Then I'm building my framework and deliver it to the developers of my team.  

What is the hope is that only other developers have to import them. It is okay to use all my framework categories when I Instead of using categories I subclass, but this is not what I hope.

For a while, I use my categories to work in my framework and specify to my developers I should use them - flag at the OBJC "Other Linker Flags" settings and import each category like this:

  #import & lt; myFramework / MyCategory + Helper.h & Gt; #import & lt; myFramework / MyOtherCategory + Helper.h & gt; ; ...   

Maybe this is not possible but I wonder why? I'm missing something :) Thanks

PB

PS: Sorry for my English ...

As Captain Redmond said,

I made a mistake after some attempts, I think that -all_load also works for the import of these categories with the Linker flag. My mistake was in my main header file: bad imports, some things missing etc. Finally, my project was not reloaded after setting the -all_load flag.

I now have MyFramework.h :

  #import "MyCategory + Helper.h" #import "MyOthercategory + Helper.h" # Import "AClass.h" ... ...   

In my project where I use the framework:

1 / Setup "Other Linker "

Import & lt; myFramework / myFramework.h & gt; reload XCode

then I do not have to import all the other stuff into my project

thanks Captain Redbaugh, I already Only your own Paddy was tested but in vain. After more testing it is okay!

* Edit everything works fine till I go to one of my class which is one of my class XCode uses to specify that I have an error like the class was not present when I clean my code, even then the same problem: ((

No visible interface. .. declares the selector ...

** Edit if I import & lt; MyFrameWork / myFramework & gt; myProjectApp-Prefix.pch but not within #ifdef __OBJC__ conditional , that's OK.

No comments:

Post a Comment