Your question title is about master/detail view controller communication. But a compiler warning seems to be at the heart of your question.
It's a matter of method signatures.
[[RoomList sharedStore] createItem:item];
This calls method signature is -createItem:
. You declare -(RoomItem *)createItem;
or -createItem
. Note there's no colon, no passed in parameter.
It seems unlikely that you would pass a RoomItem
in to a method named createItem
so you likely want to just change the above call to:
RoomItem *item = [[RoomList sharedStore] createItem];
// item is now the newly created entity.
Or change the createItem
method to something like:
-(RoomItem *)createItemWithRoom:(NSString *)room andBuilding:(NSString *)building{
// Use room & building to create managed object
}
And then use it like:
RoomItem *item = [[RoomList sharedStore] createItemWithRoom:[_roomTxt text] andBuilding:[_buildingTxt text]];
EDIT
If you're trying to refresh the master tableview in the detail view of a split view controller (on iPad) you can use code like this to reload the master tableview.
UINavigationController *masterController = [self.splitViewController.viewControllers objectAtIndex:0];
UITableViewController *tableController = (UITableViewController *)masterController.visibleViewController;
UITableView *tableView = tableController.tableView;
[tableView reloadData];
On the iPhone/iPod you can obtain the navigation controllers root view controller and refresh the table view with code like this.(written a bit more compactly)
UITableViewController *masterTableViewController = [self.navigationController.viewControllers objectAtIndex:0];
[masterTableViewController.tableView reloadData];
Of course instead of a full reload you could use a method like insertRowsAtIndexPaths:withRowAnimation:
if you know the future indexPath(s)
at the time of insertion.