• 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: Cocoa and Gestalt?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa and Gestalt?


  • Subject: Re: Cocoa and Gestalt?
  • From: Sherm Pendley <email@hidden>
  • Date: Wed, 12 Mar 2003 02:07:37 -0500

On Tuesday, March 11, 2003, at 05:04 PM, Carl Bell wrote:

specific case, I don't want to check for version 10.2 of the OS, I want to check to see if the AddressBook API is available.

Is the AddressBook API in a separate bundle, or is it part of AppKit/Foundation? (I'm asking because I don't have 10.2 to check.)

If it is, you could try loading the framework with NSBundle's +bundleWithPath: or -initWithPath methods - those methods will return nil if the indicated path can't be loaded as a bundle for any reason. If the AddressBook API is part of the standard frameworks, you can skip this part, and simply try to create the Class object.

You'll need a Class object in order to call its +alloc method. You can get a Class by calling the NSClassFromString() function. This function returns nil if there is no class loaded that has the requested name, so that's another opportunity to check whether the class you want to use is available.

sherm--

C programmers never die - they're just cast into void.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Cocoa and Gestalt? (From: Carl Bell <email@hidden>)

  • Prev by Date: LaunchServices vs exec()
  • Next by Date: Re: Is there a Java Cocoa File Chooser Dialog?
  • Previous by thread: Cocoa and Gestalt?
  • Next by thread: Re: Can I require 10.2?
  • Index(es):
    • Date
    • Thread