Back navigation issue using code
<p>I am doing json parsing application. In which there is not an issue regarding parsing. I am having list uptill the <strong>type="0"</strong>. But <strong>type="1"</strong> is having a description. All the <strong>"listing"</strong> as well as the <strong>"description"</strong> is set properly.</p>

<pre><code>{"pageid":"5824","title":"Sms Collection","type":"0","desc":"Friendship SMS:$@|5825|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Love SMS:$@|5826|@$:4cing.com/mobile_app/uploads/pageicon/Love.png;Miss U SMS:$@|5827|@$:4cing.com/mobile_app/uploads/pageicon/missu.png;Funny SMS:$@|5828|@$:4cing.com/mobile_app/uploads/pageicon/funny.png;Valentine SMS:$@|5829|@$:4cing.com/mobile_app/uploads/pageicon/valantine.png;Adult SMS:$@|5830|@$:4cing.com/mobile_app/uploads/pageicon/adult.png;Anniversary SMS:$@|5832|@$:4cing.com/mobile_app/uploads/pageicon/anniversary.png;Birthday SMS:$@|5833|@$:4cing.com/mobile_app/uploads/pageicon/birthday.png;Break up SMS:$@|5834|@$:4cing.com/mobile_app/uploads/pageicon/Breakup.png;Broken Heart SMS:$@|5835|@$:4cing.com/mobile_app/uploads/pageicon/heartbroken.png;Christmas SMS:$@|5836|@$:4cing.com/mobile_app/uploads/pageicon/Christmas.png;Exam SMS:$@|5837|@$:4cing.com/mobile_app/uploads/pageicon/exam.png;Flirt SMS:$@|5838|@$:4cing.com/mobile_app/uploads/pageicon/flirtsms.png;Good Luck SMS:$@|5839|@$:4cing.com/mobile_app/uploads/pageicon/goodluck.png;Good Morning SMS:$@|5840|@$:4cing.com/mobile_app/uploads/pageicon/goodmornig.png;Good Night SMS:$@|5841|@$:4cing.com/mobile_app/uploads/pageicon/goodnight.png;Insult SMS:$@|5842|@$:4cing.com/mobile_app/uploads/pageicon/inseart.png;Pashto SMS:$@|5843|@$:4cing.com/mobile_app/uploads/pageicon/pashto.png;Poetry SMS:$@|5844|@$:4cing.com/mobile_app/uploads/pageicon/poetry.png;Sardar SMS:$@|5845|@$:4cing.com/mobile_app/uploads/pageicon/sardar.png;Santa Banta SMS:$@|5846|@$:4cing.com/mobile_app/uploads/pageicon/santabanta.png;Smile SMS:$@|5847|@$:4cing.com/mobile_app/uploads/pageicon/smile.png;Sorry SMS:$@|5848|@$:4cing.com/mobile_app/uploads/pageicon/sorry.png;Chanakya SMS:$@|5849|@$:4cing.com/mobile_app/uploads/pageicon/chanakya.png;","cache":"1","Nexturl":"5825","prevurl":"0","bckurl":"0"}
</code></pre>

<p>when application is launched (type="0") this is the first list with above data.</p>

<p><img src="http://i.stack.imgur.com/NwF8w.png" alt="enter image description here"></p>

<p>Onclick of <strong>Friendship SMS</strong> cell i am getting (type="0") this data.</p>

<pre><code>{"pageid":"5825","title":"Friendship SMS","type":"0","desc":"Do not lie, Do not cheat and do not make promises :$@|5850|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;There are no strings attached to a friendship, no :$@|5851|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;friends are like stars. You ca not always see them:$@|5852|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Friends should b like zero. when u add, they r sam:$@|5853|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Friendship is like a glass handle it with care bec:$@|5854|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;A friend gives hope when life is low, a friend is :$@|5855|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;How long shall we be friends? Do you want a clue? :$@|5856|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;My friendship is nothing but a round, Wandering wh:$@|5857|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;When nails are growing, We cut our nails, Not fing:$@|5858|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;A true friend understands when u say I forgot, wai:$@|5859|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Making a million friends is not an achievement, Th:$@|5860|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Friendship and Medicine both r good 4 our health:$@|5861|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;A memory lasts forever, and never does it die. Tru:$@|5862|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Where there is no compromise in telling the secret:$@|5863|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;I m not Wealthy but i have Rich Heart, I m not Bes:$@|5864|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Do not Love a Friend who Hurts U Do not Hurt a Fri:$@|5865|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;To hear what is unspoken, to see what is invisible:$@|5866|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Life is 5 star Mother is top star Father is king s:$@|5867|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;A single rose can be my garden A single friend, my:$@|5868|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;To live a life i need heartbeat, 2 have heartbeat :$@|5869|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;A true relationship is when you can tell each othe:$@|5870|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Friends\" are like balloons once u let them go u ca:$@|5871|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;MY friendship is just like a rubber band, It is to:$@|5872|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;I wish every relationship come with the same tag a:$@|5873|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;As precious as u r to me, As precious no one can e:$@|5874|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;Friendship Must Never Be Buried Under The Weight O:$@|5875|@$:4cing.com/mobile_app/uploads/pageicon/friendship.png;","cache":"1","Nexturl":"5850","prevurl":"5824","bckurl":"5849"}
</code></pre>

<p><img src="http://i.stack.imgur.com/lUcAC.png" alt="enter image description here"></p>

<p>Finally this is having (type="1") for the screen onclick of <strong>"Do not lie,Do not che..."</strong>
So description is shown as</p>

<p><img src="http://i.stack.imgur.com/Wxprv.png" alt="enter image description here"></p>

<p>I am having problem in the back process, i have to use <strong>prevurl</strong> which is similar to the <strong>pageid</strong> of rhe previous page, for the back functionality </p>

<p>This is the code which i am doing for the back functionality,</p>

<pre><code>-(IBAction)btnBackClicked:(id)sender
{
    int Type;

    NSMutableDictionary *tempDict1;

    for(int i=0;i&lt;[test.JsonPageList count];i++)
    {
        tempDict1 = [[NSMutableDictionary alloc]init];
        tempDict1 = (NSMutableDictionary *)[test.JsonPageList objectAtIndex:i];
        NSLog(@"pageid is.....%d",[[tempDict1 valueForKey:@"pageid"] intValue]);
        if ([[tempDict1 valueForKey:@"pageid"] intValue]) 
        {
            Type = [[tempDict1 valueForKey:@"type"] intValue];

            if (Type == 0) 
            {
                NSArray *arr=[[tempDict1 valueForKey:@"desc"] componentsSeparatedByString:@";"];
                NSString *subStar = @"|@$:";
                NSString *sub=@":$@|";

                [test.arrTitle removeAllObjects];
                [test.arrnew removeAllObjects];
                [test.arrId removeAllObjects];
                [test.arrImages removeAllObjects];

                for (int i=0; i&lt;[arr count]-1; i++)
                {
                    [test.arrTitle addObject:[[arr objectAtIndex:i] substringToIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:sub])-4]];
                    [test.arrnew addObject:[[arr objectAtIndex:i] substringFromIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:sub])]];
                    [test.arrId addObject:[[test.arrnew objectAtIndex:i] substringToIndex:NSMaxRange([[test.arrnew objectAtIndex:i] rangeOfString:subStar])-4]];
                    [test.arrImages addObject:[[arr objectAtIndex:i] substringFromIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:subStar])]];
               }
                [tbl_withData reloadData];
            }
        }
    }
}
</code></pre>

<p>This is the code for the parsing</p>

<pre><code>- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    [connection release];

    NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"SecondTime"])
    {
        [self saveData:responseData toFile:@"SMSCollection.txt"];

        results = [responseString JSONValue];

        JsonPageList = [results objectForKey:@"page"];

        desc = [[NSMutableArray alloc] init];
        for (NSString * strName in results)
        {
            JsonPageList = [results objectForKey:strName];
            dictHash = [[NSMutableDictionary alloc] init];
            [dictHash setObject:JsonPageList forKey:@"JsonPageList"];

            for (int i = 0; i &lt; [JsonPageList count]; i++) 
            {
                [desc addObject:[[JsonPageList objectAtIndex:i] valueForKey:TAG_DESC]];

                int PAGEID = [[NSString stringWithFormat:@"%@",[[JsonPageList objectAtIndex:i] valueForKey:@"pageid"]] intValue];
                [self displayPage:PAGEID];
            }
        }
    }
    [responseString release];
}

-(void) displayPage:(int)pageID
{
    page.pageid = pageID;
    if (page.type == PAGE_TYPE_MENU) 
    {
        NSString *desc1=[desc objectAtIndex:0];
        NSArray *arr=[desc1 componentsSeparatedByString:@";"];
        NSString *subStar = @"|@$:";
        NSString *sub=@":$@|";

        arrTitle=[[NSMutableArray alloc] init];
        arrImages = [[NSMutableArray alloc] init];
        arrnew = [[NSMutableArray alloc]init];
        arrId=[[NSMutableArray alloc]init];

        for (int i=0; i&lt;[arr count]-1; i++)
        {
            [arrTitle addObject:[[arr objectAtIndex:i] substringToIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:sub])-4]];
            [arrnew addObject:[[arr objectAtIndex:i] substringFromIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:sub])]];
            [arrId addObject:[[arrnew objectAtIndex:i] substringToIndex:NSMaxRange([[arrnew objectAtIndex:i] rangeOfString:subStar])-4]];
            [arrImages addObject:[[arr objectAtIndex:i] substringFromIndex:NSMaxRange([[arr objectAtIndex:i] rangeOfString:subStar])]];
        }
    }
    else if (page.type == PAGE_TYPE_CONTENT) 
    {
        NSLog(@"CURR title:- %@\n  &amp; desc:- %@",page.title1 ,page.desc);

        UITextView *TextView = [[UITextView alloc] init];
        TextView.text =  page.title1;

        UILabel *lblcurrentPage = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 300)];
        lblcurrentPage.backgroundColor = [UIColor whiteColor];
        lblcurrentPage.textColor = [UIColor blackColor];
        lblcurrentPage.text = page.desc;
    }
}
</code></pre>

<p>Help me out of this problem.</p>
