have an app that can take a picture and then upload to a server. encoding it to base 64 and pass it thru a XMLRPC to my php server.
i want to take the NSDictionary info
Three options occur to me on this, two mentioned in other answers NSKeyedArchiver and PropertyList, there is also NSJSONSerialization that gave me the most compact data in a simple test.
NSDictionary *dictionary = @{@"message":@"Message from a cool guy", @"flag":@1};
NSData *prettyJson = [NSJSONSerialization dataWithJSONObject:dictionary options:NSJSONWritingPrettyPrinted error:nil];
NSData *compactJson = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil];
NSData *plist = [NSPropertyListSerialization dataWithPropertyList:dictionary
format:NSPropertyListBinaryFormat_v1_0
options:0
error:NULL];
NSData *archived = [NSKeyedArchiver archivedDataWithRootObject:dictionary];`
Size results for the different approaches smallest to largest