I have TableViewController & ViewController.
Airports.h
@interface Airports : UITableViewController
@property(strong, nonatomic) NSNumber* latitude;
@property(strong, nonatomic) NSNumber* longitude;
@property(strong, nonatomic) NSString* selectedAirportName;
@end
Airports.m
Here is an instance that sets latitude, longitude & selectedAirportName properties.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSArray *airportNames = airportsArray[indexPath.row];
self.selectedAirportName = [airportNames valueForKey:@"$"];
NSArray *airportCoordinates = airportsCoordinates[indexPath.row];
self.latitude = [airportCoordinates valueForKey:@"Latitude"];
self.longitude = [airportCoordinates valueForKey:@"Longitude"];
}
Row selection forwards user to ViewController where I have an instance that shows GoogleMap with marker accordingly to information in selected row. How to give that instance access to latitude, longitude & selectedAirportName properties from Airports class? Actually, I wonder how can I make that properties public to operate with them out of didSelectRowAtIndexPath instance and out of Airports class.
I'm only a beginner. So don't shoot me :)