在你的类上创建一个NSMutableArray
属性,如下所示:UITableViewController
@interface CustomTableViewController : UITableViewController
@property (strong, nonatomic) NSMutableArray *dataFromOtherClass;
@end
然后当你转换时,也许像这样,你可以设置dataFromOtherClass
属性:
CustomTableViewController *controller = [[CustomTableViewController alloc] initWithNibName:@"CustomTableViewController" bundle:nil];
controller.dataFromOtherClass = myNSMutableArrayData; // <-- Set data like this
[self.navigationController controller animated:YES];
// Or ...
[self presentViewController:controller animated:YES];
// Etc...