kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 473 forks source link

Build complex Framework #135

Open fabiosoft opened 10 years ago

fabiosoft commented 10 years ago

Hi, i am making my first framework for iOS and i am in trouble. I coded all classes and there are some of theme i don't want to show to others developers (the can't alloc that particular class) so i set, in copy headers, to private or project instead of public, but of course when it's used in other projects xcode says: "File not found".

How can i resolve this??

fabb commented 10 years ago

Are your public headers importing private headers? If yes: you should avoid that and put private imports into the class files.

Besides that you also should not import private headers in other projects.

Best regards, Fabian

On Friday, July 19, 2013, Fabio Nisci wrote:

Hi, i am making my first framework for iOS and i am in trouble. I coded all classes and there are some of theme i don't want to show to others developers (the can't alloc that particular class) so i set, in copy headers, to private or project instead of public, but of course when it's used in other projects xcode says: "File not found".

How can i resolve this??

— Reply to this email directly or view it on GitHubhttps://github.com/kstenerud/iOS-Universal-Framework/issues/135 .

fabiosoft commented 10 years ago

i have this:

#import "AFnetworking.h"
@interface FNMeteoRequestOperation : AFJSONRequestOperation

so if i move the import in .m file, xcode give me errors.

fabb commented 10 years ago

Which files does Xcode complain about? Have you imported AFNetworking into the client project? As far as I have experienced, you need to import only the header files of AFNetworking into your framework projects, but do not compile AFNetworkings .m files into it. Then the client project needs to import the full AFNetworking framework or classes.

fabiosoft commented 10 years ago

I subclassed an AFHTTPClient and other AF classes. But my "customers" need to use only my subclass. So my thoughts are: build my own classes with AF classes as private (or project) headers. But I can't access to PrivateHeader folder! I am getting crazy for doing it!

fabb commented 10 years ago

You cannot do this. Your client project needs to import AFNetworking too. Your class subclasses AFHTTPClient, so it supports all public methods and properties of this superclass. So a client project that uses your class needs to know of the superclass too, which is achieved by importing the superclasses' header file.

On Friday, July 19, 2013, Fabio Nisci wrote:

I subclassed an AFHTTPClient and other AF classes. But my "customers" need to use only my subclass. So my thoughts are: build my own classes with AF classes as private (or project) headers. But I can't access to PrivateHeader folder! I am getting crazy for doing it!

— Reply to this email directly or view it on GitHubhttps://github.com/kstenerud/iOS-Universal-Framework/issues/135#issuecomment-21273067 .

fabiosoft commented 10 years ago

You gave me a very bad news.... My intention was to make a standalone SDK that I already made... But, for not reinvent the wheel, I used AF. Understand me... I want to give my customers just an import to do in their projects.

fabb commented 10 years ago

They can. But they will need to import the AF framework too. All frameworks do it this way. Even for importing the AF framework, you need to import other frameworks too in turn.

On Friday, July 19, 2013, Fabio Nisci wrote:

You gave me a very bad news.... My intention was to make a standalone SDK that I already made... But, for not reinvent the wheel, I used AF. Understand me... I want to give my customers just an import to do in their projects.

— Reply to this email directly or view it on GitHubhttps://github.com/kstenerud/iOS-Universal-Framework/issues/135#issuecomment-21275308 .

fabiosoft commented 10 years ago

Thanks 1000 for your help. I will take this way for my projects... Usually I make everything inside my app but now I want to expand my ideas... :)

fabb commented 10 years ago

You're welcome & good luck!

On Saturday, July 20, 2013, Fabio Nisci wrote:

Thanks 1000 for your help. I will take this way for my projects... Usually I make everything inside my app but now I want to expand my ideas... :)

— Reply to this email directly or view it on GitHubhttps://github.com/kstenerud/iOS-Universal-Framework/issues/135#issuecomment-21280741 .