initwithnibname pass variable to next view
I have one view where a 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;
initwithnibname pass variable to next view
===

I have one view where a 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;