[fbcocoa] Re: [fbcocoa] How read PLIST into NSArray?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2011 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Thu, 8 Dec 2011 07:25:23 -0500
Seems I don't have to convert to XML...

This for example will list the keys...


for (id key in thePropertyList) {
NSLog(@"key: %@, value: %@", key, [thePropertyList objectForKey:key]);
}

I am wanting values:

"image/jpeg"
or 
"image/gif"

for key:

"WebResourceMIMEType" I reckon.

But not sure how to 'read' the plist data to get those alone?

And it seems the are MIME'd up, or in Base64, I can't tell.

Is this totally incorrect?

if  ( [thePropertyList valueForKey:key] = @"image/jpeg" )
{
//nab it?
}

rc

On Dec 8, 2011, at 5:34 AM, Robert Covington wrote:

> 
> Can anyone point out how I can read an XML PLIST data object into an NSArray?
> 
> NSArray * archiveArray = [NSArray arrayWithObject:(NSData *)xmlData];
> 
> arrayCount = [archiveArray count]; 
> 
> NSLog(@"My Array Count = %i", arrayCount);
> 
> Well, gives 1, as you'd expect, I guess...since there's one object, xmlData, though it has kazillions in the PLIST itself.
> 
> Is there anything which will automagically put the dang thing into the array already sorted, and elemented? To where I can then extract the image data?
> 
> NSDictionary?
> 
> This is from a Safari Web Archive, read from disk, saved out as XML (or in this case, just read into an array, I don't need to save it first, do I?
> 
> (Safari archives are in binary, I convert to XML...)
> 
> rc
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fbcocoa-unsubscribe@...
> For additional commands, e-mail: fbcocoa-help@...
>