I am trying to pass an object in NSMutablearray to another view’s NSmutableArray
I have been looking related question but couldnt figure out whats wrong.
my view switches correctly but it doesnt pass the object in my NSmutable array
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
StartHuntViewController *startHuntController = [[StartHuntViewController alloc] initWithNibName:@"StartHuntView" bundle:nil];
startHuntController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:startHuntController animated:YES];;
startHuntController.forStandButton = [stands objectAtIndex:indexPath.row];// doesnt work
// startHuntController.standLocation.text=[stands objectAtIndex:indexPath.row]; // this works
[startHuntController release];
[self.mytableView reloadData];
}
view i am trying to pass data is
.h file
@interface StartHuntViewController : UIViewController<UIApplicationDelegate,CLLocationManagerDelegate,CoreLocationControllerDelegate> {
NSMutableArray *forStandButton;
}
@property (nonatomic, assign)NSMutableArray *forStandButton;
.m file
@synthesize forStandButton;
what should i do ? i guess there is nothing wrong with code?
changed assign to retain, move the line
startHuntController.forStandButton = [stands objectAtIndex:indexPath.row];