Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a plist deserializer
After watching "Building a Server-driven User Experience" from WWDC 2010, I was inspired to build this into Core Resource.  Around halfway through the video they compare JSON, XML & Property Lists and binary plists are crazy fast to parse on iOS.  This deserializer should be able to handle binary & text plist formats.

To test this out you can configure the LighthouseClient like this:

    coreManager.remoteSiteURL = @"http://plist.heroku.com";
    coreManager.remoteSiteFormat = @"plist";

All this heroku app does is take the json feed from Lighthouse, convert it into a binary plist and serve it back up.
  • Loading branch information
isaac committed Jul 26, 2010
1 parent c8ca496 commit 6ab6b0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CoreDeserializer.h
Expand Up @@ -82,4 +82,7 @@
#ifdef DDXMLDocument
@interface CoreXMLDeserializer : CoreDeserializer
@end
#endif
#endif

@interface CorePLISTDeserializer : CoreDeserializer
@end
7 changes: 7 additions & 0 deletions CoreDeserializer.m
Expand Up @@ -324,3 +324,10 @@ - (NSArray*) resourcesFromString:(NSString*)string {

#endif

@implementation CorePLISTDeserializer

- (NSArray*) resourcesFromString:(NSString*)string {
return [self resourcesFromData:[NSPropertyListSerialization propertyListFromData:[source responseData] mutabilityOption:0 format:nil errorDescription:nil]];
}

@end

0 comments on commit 6ab6b0c

Please sign in to comment.