Welcome, Guest
Username Password: Remember me

How to use TableModel without a navigator?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: How to use TableModel without a navigator?

How to use TableModel without a navigator? 1 year, 7 months ago #1

Hello there - Fantastic work, the model is really nice.
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
#import "SCTableViewModel.h"
SCTableViewModel *tableViewModel;
IBOutlet UITableView *tv;

In the viewload event I used this code:
tableViewModel = [SCTableViewModel alloc] initWithTableView:tv withViewController:self];
SCTableViewSection *sec = [SCTableViewSection sectionWithHeaderTitle:@"Hello"];
[tableViewModel addSection:sec];
[sec addCell:[SCTextFieldCell cellWithText:@"Hi there"]];


Problem:
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??
  • amok
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0

Re: How to use TableModel without a navigator? 1 year, 7 months ago #2

Everything you're describing seems to be fine. Would you please send your project to our support email so that I can check it and tell you what's wrong? Thanks!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: How to use TableModel without a navigator? 1 year, 7 months ago #3

Thanks for sending in your project. You had two problems there:

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!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: How to use TableModel without a navigator? 1 year, 7 months ago #4

the object model is fantastically written and the support is even better.
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!

Thank you,
amok
  • amok
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0

Re: How to use TableModel without a navigator? 1 year, 7 months ago #5

Thanks a lot amok, that's really kind of you
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
Time to create page: 0.91 seconds