I know that when I do it this way, I am getting all of the data that I want into my LeftViewController, which is the tableView of a MasterDetail. And when I look at the NSLog(@"Players: %@", feed.player); I can tell that I am getting all of the data that I want from the database.
How do I access this data that I know I have to populate my DetailViewController? Should I use NSUserDefaults? Should I create a new class to fetch, parse and hold onto this data?
I am new to this all, so a point to a tutorial, or tutorial like instructions are greatly appreciated. If any more code or details are needed, please let me know.
****EDIT****
After applying the NSNotificationCenter as suggested by @soryngod, I get the following output from my NSLog(@"%@", notification.userinfo); in my RightViewController:
2013-07-04 12:20:26.208 PlayerTracking[25777:11303] {
player = (
{
currentScore = "4";
totalPenalties = (
);
id = 9;
name = "Jakob Melon";
timeStarted = "2013-06-05 19:56:10";
},
{
currentScore = 16;
totalPenalties = (
);
id = 10;
name = "John China";
timeStarted = "2013-06-06 17:21:300";
},
{
currentScore = 178;
totalPenalties = (
);
id = 11;
name = "Jason Dog";
timeStarted = "2013-06-07 19:26:10";
},
{
currentScore = 1233;
totalPenalties = (
);
id = 12;
name = "Fox Wolfe";
timeStarted = "2013-06-05 19:56:10";
},
{
currentScore = 234;
totalPenalties = (
);
id = 13;
name = "Dakota Cool";
timeStarted = "2013-06-05 19:56:10";
},
{
currentScore = "34234";
totalPenalties = (
);
id = 14;
name = "Max Face";
timeStarted = "2013-06-05 19:00:30";
},
{
currentScore = "2342";
totalPenalties = (
);
id = 15;
name = "Jonatan Blah";
timeStarted = "2013-06-05 18:00:30";
},
{
currentScore = "234234";
totalPenalties = (
);
id = 16;
name = "Thomas Bus";
timeStarted = "2013-06-05 19:56:10";
},
{
currentScore = 34566;
totalPenalties = (
);
id = 17;
name = "Super Cake";
timeStarted = "2013-06-05 17:51:30";
},
{
currentScore = "23463";
totalPenalties = (
);
id = 18;
name = "Duke Nukem";
timeStarted = "2013-06-07 19:26:10";
},
{
currentScore = "12362";
totalPenalties = (
);
id = 19;
name = "Gordon Freeman";
timeStarted = "2013-06-05 19:56:10";
}
);
}
Please, don't mind the names.
Solución
You could use [NSNotificationCenter defaultCenter] to post the userInfo to the DetailController , when the data is received you just post a notification to with the feed and you handle it on the DetailController.
To be more explicit:
you add this to your DetailViewController viewDidLoad: