I have been trying to achieve the below requirement. I could ablerequirements to get itthem working.
But want to make sure if i am Am I doing in ait the right way ?
We have a table with customised Cell. [ say (say: firstViewController]
firstViewController)Customised Cell has a button , click event in this button, carries rowand carries row index value to another view controller, and in. In this view controller iI will use this row index to accessaccess the data model from Firstfirst view controller.
Annotation: EachEach row has values associated with unique Dictionary value in Array based on row Index.
Pseudo Code:[ pasted (pasted only necessary code ])
FirstViewController.mFirstViewController.m
In the above code I set the iRecordIndexiRecordIndex to IndexPath.rowIndexPath.row
StudentCell.hStudentCell.h
StudentCell.mStudentCell.m
NextViewController.hNextViewController.h
NextViewController.mNextViewController.m
- (id)initWithRecIndex:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil Index:(NSInteger )iRecIndex
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.iRecordIndex = iRecIndex;
}
return self;
}
-(void) viewWillAppear:(BOOL)animated
{
//Get FistViewController. say ==> fvc.
NSMutableArray *mRec = [fvc MasterRecords];
NSMutableDictionary *mDict = [mRec objectAtIndex:self.iRecordIndex];
NSLog (@" value1 is %@ ", [mDict valueForKey:@"value1"]);
NSLog (@" value2 is %@ ", [mDict valueForKey:@"value2"]);
// Using value1, and value2 to display MKMapView.
}
I am afraid if it is aIs this the right approach?., or where i couldshould I improve it?