[Openmcl-devel] Trying to use AddressBook
Ralph Richard Cook
ralphc at bellsouth.net
Sat Nov 5 05:41:32 UTC 2005
The cfstring- calls got it. I'm now doing everything I wanted to do.
Thanks for the help.
On Nov 4, 2005, at 1:31 AM, Gary Byers wrote:
> On Fri, 4 Nov 2005, Ralph Richard Cook wrote:
>> Getting there. I'm now able to get to the ABAddressBook class and
>> send messages to it, etc.
>> The AddressBook framework uses pointers to constant NSStrings for
>> some properties, such as this, defined in ABGlobals.h
>> extern NSString * const kABFirstNameProperty; // First
>> name - kABStringProperty
> That declaration means that kABFirstNameProperty is a variable with
> the "const" attribute. That's somewhat different from someting
> with #define or enum.
> You should be able to access the value of this variable with the
> #& reader macro, as in:
> That'll probably print as an anonymous MACPTR. To get the type system
> to recognize it, we have to do still more work (after loading a new
> ObjC library) to identify the address ranges associated with object
> file sections that might contain static instances.
> [... elided code for loading a framework or library ...]
>> The #$ reader macro doesn't work on these, as it does with numeric
>> properties, for example #$kABMultiDateProperty, and I don't think
>> I can get to the string directly so I could copy it with a #@""
>> reader macro.
> It's also worth noting that there's a difference between
> ? #@"FOO"
> #<NS-CONSTANT-STRING "FOO" (#x107080)>
> ? (ccl::%make-nsstring "FOO")
> #<NS-MUTABLE-STRING "FOO" (#x1E42D0)>
> (The latter's likely to actually be an instance of the ObjC NSCFString
> class. Even though that ObjC class is docmented and somewhat public,
> it's not actually declared in the Cocoa header files, and the type
> system recognizes it as an instance of a declared superclass of
More information about the Openmcl-devel