Re: NSData as value in NSManagedObject
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