Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dman90

macrumors newbie
Original poster
Jun 25, 2011
22
0
Hi Guys,

I have a simple login page, and when the user enters the right details, its loads a new page. The new page is meant to be a table with 4 coloums. However when I perform segue, an empty table controller is loaded, with no information at all.

This is the code I use:

Code:
mainTableController *aaa = [[mainTableController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:aaa];
    
    [self presentModalViewController:navController animated:YES];

How Do I make sure the data is loaded with the segue?

Any help would be appreciated.

----------

Also, My table is static, with 4 coloums. Each of these coloums include a UIImage and a label.
 
Yes I have looked at it, but I'm not sure how to assign 4 pictures, and 4 labels to my static table once it joins?

Based on looking at your code, I don't think you're using a segue. (A segue is the transition that you would set up between views in a storyboard file.)

For what you have right there, I don't know what the most "correct" way of doing it is, but I'd probably have several properties for mainTableController which I would assign after creating the table and before presenting it.

It'd go something like:

Code:
mainTableController *aaa = [[mainTableController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:aaa];
aaa.string1 = @"Something passed.";
aaa.string2 = @"Another thing passed.";
[self presentModalViewController:navController animated:YES];

In the cellForRow method, I'd then assign the contents of the cells to be equal to the strings.

Except... you're using static cells? I haven't used those before, but I remember those were mentioned in the tutorial I've posted a link to below, which if you read through parts 1 and 2, I think should answer your question...

http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.