Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Using FlipViews

Using FlipViews 1 year, 3 months ago #1

Hi Tarek, thank you for pointing this out to me - I am using a Flip View through the xCode template. This results in creating a ViewController rather than a NavController.

I appreciate that without a NavController, I wont be able to have top buttons and some navigation control. However, this little app doesn't have much navigation - just two views.

I would like the table on each side to be linked through CoreData - they are like the opposite sides of the same coin.

Can I build this project this way with STV?

Thank You...

David

Re: Using FlipViews 1 year, 3 months ago #2

Hi David,


I appreciate that without a NavController, I wont be able to have top buttons and some navigation control. However, this little app doesn't have much navigation - just two views.


I actually suggested a navigation controller earlier since the project you sent me has code that is adding buttons to a navigation bar (e.g. "self.navigationItem.leftBarButtonItem = self.editButtonItem" in FlipsideViewController.m). You should not be accessing self.navigationItem if your view controller has not been pushed into a navigation controller stack.


Can I build this project this way with STV?


Sure you can. What fields exactly do you want to have on the table view?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Using FlipViews 1 year, 3 months ago #3

Hi Tarek,

re : "self.navigationItem.leftBarButtonItem = self.editButtonItem" in FlipsideViewController.m" - got it.. it's gone.

I only want these fields:

Side1: 1. Text line, 2. small image, 3. text box
Side2: Same.

The text line on Side 2 will be the translation of the Text Line in side 1.

Thanks a ton..

Anything I can do to repair my Karma?

David

Re: Using FlipViews 1 year, 3 months ago #4

Great...

Here are the main guidelines that you should be following:

1. Storage:
a. If both views have an identical set of data (and you don't envision that this will ever change in the future), then create just one Core Data entity that will store the field values of both views. In this case, you'll be creating two Core Data objects as soon as the application starts for the first time, one object for each view.
b. If each view has a separate set of data, then create an entity for each view (I personally prefer this option). As soon as the application is launched for the first time, create an object from each of the two entities.

2. UI (in each one of the view controllers):
a. Create the class definition normally for the respective entity.
b. Create an SCObjectSection with this class definition, and associate it with the object that was created earlier (see "Storage" above). Here is a code sample:

 
...
SCObjectSection *objectSection =
[SCObjectSection sectionWithHeaderTitle:nil
withBoundObject:sideAObject withClassDefinition:sideAClassDef];
[tableModel addSection:objectSection];
...
 


c. Detect any modifications that happen inside each view and do whatever you need to update the other view's object's fields. You can detect modifications by implementing the SCTableViewModelDelegate method called "tableViewModel:valueChangedForRowAtIndexPath:"


Hope this helps!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
Last Edit: 1 year, 3 months ago by tarekskr.
  • Page:
  • 1
Time to create page: 1.47 seconds