• 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: NSData as value in NSManagedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData as value in NSManagedObject


  • Subject: Re: NSData as value in NSManagedObject
  • From: Mikkel Eide Eriksen <email@hidden>
  • Date: Sat, 20 Feb 2010 17:02:07 +0100

Heh, it actually works currently though. That is a straight copy from my running code.

Oh, I get it now! selectedObjects is obviously an array, so when I send valueForKey:@"xml" to it, I get an array of the results of that call on each element - thus requiring lastObject.

So really the lastObject can go either place. Thanks!

Mikkel

On 20/02/2010, at 16.54, Alexander Spohr wrote:


Am 20.02.2010 um 16:29 schrieb Mikkel Eide Eriksen:

NSData *xmlData = (NSData *)[[[treeController selectedObjects] valueForKey:@"xml"] lastObject]; //HERE'S THE PROBLEM

Well, yes.

You ask your xml for lastObject. That won’t work.
What you want is this:
[[[treeController selectedObjects] lastObject] valueForKey:@"xml"]

Ask the array for its lastObject, then get the xml out of it ;)

	atze


_______________________________________________

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: 
 >NSData as value in NSManagedObject (From: Mikkel Eriksen <email@hidden>)
 >Re: NSData as value in NSManagedObject (From: Mikkel Eide Eriksen <email@hidden>)
 >Re: NSData as value in NSManagedObject (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: NSData as value in NSManagedObject
  • Next by Date: Re: Monitoring other application preferences changes
  • Previous by thread: Re: NSData as value in NSManagedObject
  • Next by thread: Overriding NSPopUpButton
  • Index(es):
    • Date
    • Thread