Re: Cocoa and Gestalt?
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.