• 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: Plist to tableview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plist to tableview


  • Subject: Re: Plist to tableview
  • From: "Kyle Sluder" <email@hidden>
  • Date: Wed, 19 Nov 2008 20:11:13 -0500

On Wed, Nov 19, 2008 at 6:45 PM, Richard S. French <email@hidden> wrote:
> Newbie question:
> How does one import an array of values from a dictionary (plist) and display
> on a window?

Deserialize the plist into an NSArray object.  Provide the values from
the NSArray to an NSTableView using a data source, or bind the table
view to an NSArrayController that's bound to the array.

> It seems that the plist has to be translated to XML data and every byte read
> into an array.

Huh?  Read the Property List Programming Guide again:
http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/PropertyLists.html

> How does one then select just certain members where the plist contains an
> array under a key?

Loop through the array that results from deserialization and choose
only the entries you want.  Alternatively, use an NSPredicate.

> I am trying to get this list into a tableview but not sure how to populate
> the data.

NSTableView has a -setDataSource: method that takes an object which
conforms to the NSTableViewDataSource protocol.  Or you can use
bindings (not recommended for a beginner).

--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

References: 
 >Plist to tableview (From: "Richard S. French" <email@hidden>)

  • Prev by Date: Re: Outlets / IBOutlet declarations (was Re: InterfaceBuilder &Wiring Objects)
  • Next by Date: Re: Cocoa apps protection software
  • Previous by thread: Plist to tableview
  • Next by thread: Re: Plist to tableview
  • Index(es):
    • Date
    • Thread