• 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: Questions about manipulation of plist file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Questions about manipulation of plist file
      • From: Miro Jurišić <email@hidden>
References: 
 >Questions about manipulation of plist file (From: "Alex Guo" <email@hidden>)
 >Re: Questions about manipulation of plist file (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: Questions about manipulation of plist file
  • Next by Date: Re: Questions about manipulation of plist file
  • Previous by thread: Re: Questions about manipulation of plist file
  • Next by thread: Re: Questions about manipulation of plist file
  • Index(es):
    • Date
    • Thread