I make a UITableView filled cell data with sqlite db table records. Each UITableViewCell is a record related to a table record.
Now I want to use – (void) tableView : (UITableView *) tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath method to goto the record detail view, I want to select from table with the record id. But this didSelectRow method has indexPath argument, I am able to write
- (id) initWithIndexPath:(NSIndexPath *)indexPath {
if (self = [super init ]) {
index = indexPath;
}
return self;
}
but now I want to right a method initWithCityId method
- (id) initWithCityId: (NSString * )_cityId {
}
How to assign this extra paramter( record id property) to detail view controller when did selected a UITableViewCell?
Assuming the city ID is part of your table view data source, get it in the didSelectRow… method the same way as you do in cellForRowAtIndexPath… you can then pass it to (presumably) your detail view controller.