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 6971381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:49:58+00:00 2026-05-27T16:49:58+00:00

I have one view where I read json data. and extract keys from it.

  • 0

I have one view where I read json data. and extract keys from it.

in – (void)viewDidLoad {
I do the following:

hotellat = [rows4 valueForKey:@"H_LAT"];
hotellon = [rows4 valueForKey:@"H_LON"];

Then I perform a push after the viewDidLoad like below:

- (IBAction)buttonClicked:(id)sender
{
    NSLog(@"hotellat: %@",hotellat);
    MapTutorialViewController *controller = [[MapTutorialViewController alloc] initWithNibName:@"MapTutorialViewController" bundle:[NSBundle mainBundle]];
    controller.LAT = hotellat;
    controller.LON = hotellon;
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
}

NSlog in this section shows that hotellat is null, but when I write the nslog in the viewDidload, there is a value. What is it that I need to do to get this variable to pass to next view? also this is a string, and I think I need to convert it to integer so I can assign it to the latitude in map view?

I also @synthesize hotellat, hotellon; in the controller and have the following in the .h file:

@property (nonatomic, retain) NSString *hotellat;
@property (nonatomic, retain) NSString *hotellon;
  • 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-27T16:49:59+00:00Added an answer on May 27, 2026 at 4:49 pm

    though you are using retained variables but retain message is not being sent to the values by this assignment:

    hotellat = [rows4 valueForKey:@"H_LAT"];
    hotellon = [rows4 valueForKey:@"H_LON"];
    

    use:

    self.hotellat = [rows4 valueForKey:@"H_LAT"];
    self.hotellon = [rows4 valueForKey:@"H_LON"];
    

    this way the retain message will be passed to the value and it will be ensured that it stays there until you release it explicitly.

    later on you can release the values:
    lets say after: [controller release];

    [hotellat release];
    [hotellon release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When submitting one form from view, how can i also read or have controller
I have the CakePHP stack in /var/www/site from one view under controller A I
I have the following situation: There is one custom view inside of the first
I have a UIImagePickerController as one view in a TabBar setup. Is it possible
I have senario in which one view and view has binding with multiple ViewModel.
I have two views within one .xib (one view for landscape, another for portrait).
I have an integer variable ( time ) in one view controller whose value
I have a multi view application with individual UIViewControllers and xibs. I have one
I have two views, one view takes the whole screen, the second view covers
We have FireSymfony that allows one to view the Symfony, PHP variables in a

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.