• 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: Newbie question: application architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: application architecture


  • Subject: Re: Newbie question: application architecture
  • From: "A. Jetha" <email@hidden>
  • Date: Fri, 17 Aug 2001 10:33:22 -0400

The following applies to ObjC. I'm not sure whether it applies to Carbon or other environments.

Bundle is an important concept. The application is a bundle (called the mainBundle), Frameworks are a kind of bundle and of course there is the normal bundle.

Frameworks differ from bundles in that they can work as shared libraries if desired and the frameworks loadable code can versioned (something very cool).

You can link your app against normal frameworks and ones that are built as shared libs. If you link your app to these frameworks, the code is implicitly loaded at launch time.

You can manually load normal frameworks and bundles at any time with the following code snippet.

NSBundle *myBundle = [NSBundle bundleWithPath:@"your path here"];

// load the code & instantiate the principle class
myObject = [[[myBundle principalClass] alloc] init];
// you could also do this
// [myBundle load]

after this point you can instantiate classes in that loaded bundle as normal once you have the bundle inited, you can get to the resources (nibs and other files) by using the series of 'pathForResourceOfType' methods (see NSBundle.h) (loading resources from the main executable works the same way)

Hope this helps ...

./aj



On Thursday, August 16, 2001, at 05:56 PM, Jeff Howe wrote:

The question I have here is how to implement this application architecture
under Cocoa. I have read about Frameworks and Buldles, but I am not sure
which is more appropriate to use, and not clear that either of these really
suits our needs, and if so, how to go about using them. OK, that's about 5
questions -- hopefully, you get the idea. I also have other questions
pertaining to how best to go about making Project Builder projects for
these, but those are probably better addressed in the projectbuilder-user
list, right?


  • Prev by Date: Re: Mac OS X 10.1 Dock Menu Description and APIs
  • Next by Date: Re: Poll.h
  • Previous by thread: Re: Newbie question: application architecture
  • Next by thread: NSMovieView with subviews ?
  • Index(es):
    • Date
    • Thread