Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-13-2009, 11:50 AM   #8 (permalink)
smithdale87
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,956
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Code:
NSMutableString* stringEncodedPlist = [[NSMutableString alloc] init];
for( NSDictionary* item in root )
{
     NSArray* contentAry = [item objectForKey:@"content"];
     NSString* name = [contentAry objectAtIndex: 1];
 
    NSDictionary* subItem = [contentAry objectAtIndex: 0 ];
    NSString* subText = [subItem objectForKey:@"Text"];
    NSString* subName = [subItem objectForKey: @"Name"];

   //here you want to combine all the elements
    NSString* result = [NSString stringWithFormat:@"****%@****%@****%@", subText, subName, name];

   [stringEncodedPlist appendString: [NSString stringWithFormat:@"%@^^^", result];
}


//do other stuff
[stringEncodedPlist release];
Now you should have a string where each "Item" in your plist is sepearted by '^^^'. Then within each "Item", the contents of the "Content" array, and the "Name" should all be separated by "***". I'm sure you can easily reverse this operation without me having to explain it.

By the way, I havent tested this, it's just a shot in the right direction, but theoretically it should work, although it may not be the best solution.
smithdale87 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,024
Threads: 93,868
Posts: 401,934
Top Poster: BrianSlick (7,964)
Welcome to our newest member, davincic
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:32 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.