Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3333548
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:48:33+00:00 2026-05-17T23:48:33+00:00

I am using TouchJSON to retrieve the JSON response from http://enbr.co.cc/TrailsApp/shops.php . In my

  • 0

I am using TouchJSON to retrieve the JSON response from http://enbr.co.cc/TrailsApp/shops.php. In my app I use this code to handle a url scheme.

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
    if (!url) {
        return NO;
    }
    NSString *urlString = [url absoluteString];
    NSString *urlStringDecoded = [urlString stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
    NSArray *list = [urlStringDecoded componentsSeparatedByString:@"="];
    NSString *urlPrefix = [list objectAtIndex:0];
    NSString *name = [list objectAtIndex:1];
    if ([urlPrefix isEqualToString:@"tridetrails://opentrail?name"]) {
        TrailViewController *trailViewController = [[TrailViewController alloc] initWithNibName:@"TrailViewController" bundle:[NSBundle mainBundle]];
        trailViewController.trailToGoto = name;
        [self.navigationController pushViewController:trailViewController animated:YES];
        [trailViewController release];
    }
    if ([urlPrefix isEqualToString:@"tridetrails://openshop?name"]) {
        ShopViewController *shopViewController = [[ShopViewController alloc] initWithNibName:@"ShopViewController" bundle:[NSBundle mainBundle]];
        shopViewController.shopToGoto = name;
        [self.navigationController pushViewController:shopViewController animated:YES];
        [shopViewController release];
    }
    return YES;
}

How can I push the correct entry from my NSDictionary created from the JSON to the ShopViewController based on the NSString name? Here is my dictionary printed out by NSLog with NSLog(@”%@”, myObj);. Thanks in advance.

{
    shops =     (
                {
            blurb = "Bootdoctors blurb";
            image = bootdoctorslogo;
            locations = "Mountain Village";
            motto = "Bootdoctors shop motto";
            name = Bootdoctors;
        },
                {
            blurb = "Easy Rider blurb";
            image = easyriderlogo;
            locations = Telluride;
            motto = "Easy Rider shop motto";
            name = "Easy Rider";
        },
                {
            blurb = "Paragon Ski & Sport blurb";
            image = paragonskiandsportlogo;
            locations = Telluride;
            motto = "Paragon shop motto";
            name = "Paragon Ski & Sport";
        },
                {
            blurb = "Telluride Sports blurb";
            image = telluridesportslogo;
            locations = "Telluride and Mountain Village";
            motto = "Telluride Sports shop motto";
            name = "Telluride Sports";
        }
    );
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:48:33+00:00Added an answer on May 17, 2026 at 11:48 pm

    You probably need to give a bit more information about what you are trying to do. For instance you don’t say how you retrieve the dictionary containing the details of all the shops and how ShopViewController has access to this dictionary. But selecting one shop by name from the dictionary can be done with something like this:

    NSDictionary *jsonResponse; // You don't say how the ShopViewController has access to
                                // the response so let's just assume a local variable here.
    
    NSDictionary *foundShop = nil; // This will be selected shop after the search below
    
    NSArray *shops = [jsonResponse objectForKey:@'shops'];
    
    for (NSDictionary *shop in shops) {
        if ([shop objectForKey:@'name'] isEqualToString:self.shopToGoto]) {
            foundShop = shop;
            break;
        }
    }
    
    if (foundShop) {
        // Do something with the dictionary keys and values in foundShop
    }
    else {
        // Error condition - shop with required name is not present
        // Handle error
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using TouchJSON to retrieve info for my app and put it in
I currently have a UITableViewController that parses a JSON response (using TouchJSON) fired asynchronously
Using jQuery's UI Tabs. This is my code. <div id=tabs> <ul> <li><a href=#tabs-1>Find a
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
How can i make a SOAP call using TouchJson? it just work fine with
I am using touch JSON which worked out pretty well for me. I was
I want to integrate AdMob ads in my iPhone app. I'm using IB way
Using PHP, I'm trying to give each specific text its own variable. I believe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.