How to use TableModel without a navigator?
Posted 14 October 2010 - 08:19 PM
However I am having trouble to understand how to use the basics in an app that doesn't uses the navigator.
Here's what I have done:
Create an empty app with my own view
Dropped a table on the view via IB
- linked outlets: delegate and tableview to UITable in my code - called tv below.
in the header file
IBOutlet UITableView *tv;
In the viewload event I used this code:
tableViewModel = [[SCTableViewModel alloc] initWithTableView:tv withViewController:self];
SCTableViewSection *sec = [SCTableViewSection sectionWithHeaderTitle:@"Hello"];
[sec addCell:[SCTextFieldCell cellWithText:@"Hi there"]];
nothing happens. The table view is all gray, default color.
Should I connect something in IB?
Should I set some properties?
What am I missing??
Posted 15 October 2010 - 02:59 AM
Posted 15 October 2010 - 11:12 AM
1- You instantiated SCTableViewModel in the loadView method, while you should always do that in the viewDidLoad method.
2- You haven't created a property for your outlet, which is not recommended as the table view does not get retained that way.
I've fixed these issues and sent you back your project. Please tell me if you're having any more issues. Good luck!
Posted 15 October 2010 - 11:34 AM
Excellent and thank you - I was already recommending ST to friends now I am going to add the reference in the about of the app as well!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users