How can I display MSMutableArray data in a UITableViewController?

I get data from NSTextField and save the data in NSMutableArray. I want to show the same data in another class that is in a child of a UITableViewController.

How can I show NSMutableArray data in myTableView, which is another class?

Please help me. Of course, I will evaluate if I have found the right path.

+3
source share
2 answers

Your tableView is in a class MyViewController. You need to create an attribute NSMutableArray *sourceArrayfor this class, as well as a property associated with it, using, for example:

@property (nonatomic, retain) NSMutableArray *sourceArray;

, View Controller , , sourceArray:

MyViewController *mvc = [[MyViewController alloc] initWith...];
mvc.sourceArray = theResult;
[self presentModalViewController:mvc animated:YES];
[mvc release];

sourceArray Table View.

+2

NSMutableArray , .

0

Source: https://habr.com/ru/post/1789721/


All Articles