Re: Questions about manipulation of plist file
Re: Questions about manipulation of plist file
- Subject: Re: Questions about manipulation of plist file
- From: "Alex Guo" <email@hidden>
- Date: Wed, 1 Dec 2004 12:23:39 +0800
> Potentially the CFPropertyListRef is either a CFArrayRef or a
> CFDictionaryRef. Once cast, you can access your values using the
> CFArrayRef or CFDictionaryRef APIs.
Yes, I aslo think that CFPropertyListRef is either a CFArrayRef or a
CFDictionaryRef.
But it seems that it's not correct way to use the following methods:
CFDictionaryRef dict = (CFDictionaryRef )propertyList;
or
CFDictionaryRef dict = dynamic_cast<CFDictionaryRef>propertyList; (error
occurs when building)
then, I use CFDictionaryGetValue() to get the value of specified key:
char *p = CFDictionaryGetValue(dict, "City of Birth");
But error occurs. (BAD_ACCESS) , sigh....
So, I think, the memory structure of CFDictionaryRef is different from
CFPropertyListRef, am I right ?
and how can I cast CFPropertyListRef to CFDictionaryRef ?
----- Original Message -----
From: "Stephane Sudre" <email@hidden>
To: "Alex Guo" <email@hidden>
Cc: <email@hidden>
Sent: Wednesday, December 01, 2004 12:18 AM
Subject: Re: Questions about manipulation of plist file
>
> Le 30 nov. 04, à 13:54, Alex Guo a écrit :
>
> > Hi, erverybody,
> >
> > I've a question about the manipulation of plist file.
> > While I get the handler (CFPropertyListRef) of a plist file, how can
> > get the value of specified key? Thanks in advance.
>
> Have a look at the document for CFArrayRef and CFDictionaryRef.
>
> Potentially the CFPropertyListRef is either a CFArrayRef or a
> CFDictionaryRef. Once cast, you can access your values using the
> CFArrayRef or CFDictionaryRef APIs.
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden