• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to share Cocoa classes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to share Cocoa classes?


  • Subject: Re: How to share Cocoa classes?
  • From: Jesse Armand <email@hidden>
  • Date: Mon, 6 Jul 2009 19:51:26 +0800

Hello Alex,

If you don't want to build a framework, best way to go is building a
static library or else you have to add their sources every time you
want to use it on a new project.

Static library linking with ObjC class, most likely could be done
successfully by only adding -ObjC and -all_load to the "Other Linker
Flags" in the build configuration.

To be able to use

#import <MyDir/MyClass.h>,

you need to add a header search path, that refers to that global
directory (or system directory, if you prefer) in your project
settings.

Jesse Armand
----------------------------------------
(http://jessearmand.com)



On Mon, Jul 6, 2009 at 4:23 PM, Alexander Bokovikov<email@hidden> wrote:
> Hi, All,
>
> Maybe it's a dummy question, but I can't find a way to share some ObjC
> classes with several XCode projects. I've created a set of Cocoa classes (.h
> and .m files) What I'd like to get is the ability to write something like
> this:
>
> #import <MyDir/MyClass.h>
>
> I don't want to distribute these classes, as a framework, but I would like
> just to link them directly into every executable, which refers them. As I
> heard, a static library, having ObjC classes inside, may cause some problems
> in linking. Therefore I yet didn't try this way.
>
> My question is: can I copy these shared files (.h + .m) into some system
> directory to make them being visible for any Cocoa project through the
> import directive, like above?
>
> If no, then what is the correct way to go besides manual inclusion of the
> same files into every XCode project?
>
> -Thanks.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to share Cocoa classes? (From: "Alexander Bokovikov" <email@hidden>)

  • Prev by Date: Re: Long term performance of NSConnection
  • Next by Date: Subject: Re: How to share Cocoa classes?
  • Previous by thread: How to share Cocoa classes?
  • Next by thread: Re: How to share Cocoa classes?
  • Index(es):
    • Date
    • Thread