• 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: CFPreferences and init.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFPreferences and init.


  • Subject: Re: CFPreferences and init.
  • From: "Kyle Sluder" <email@hidden>
  • Date: Sat, 25 Oct 2008 18:39:34 -0400

On Sat, Oct 25, 2008 at 6:11 PM, Adam Penny <email@hidden> wrote:
> My question is how do I do the checks for the if clause?

The documentation says that if the key doesn't exist, the function
returns NULL.  So then you just check to see if your servers variable
is null.  The documentation also mentions using CFGetTypeID to
determine if a CFPropertyListRef is an array or some other type.  And
NSMutableArray is toll-free bridged to CFMutableArrayRef.  So:

servers = CFPreferencesCopyAppValue( CFSTR("servers"), appID);
if(servers && CFGetTypeID(servers) == CFArrayGetTypeID())
{
  // woohoo!
}

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CFPreferences and init.
      • From: Adam Penny <email@hidden>
References: 
 >CFPreferences and init. (From: Adam Penny <email@hidden>)

  • Prev by Date: CFPreferences and init.
  • Next by Date: Re: Disable Sorting in NSTableView
  • Previous by thread: CFPreferences and init.
  • Next by thread: Re: CFPreferences and init.
  • Index(es):
    • Date
    • Thread