0

i m pretty stuck on this one rite now let me explain the problem this way:

  • Motor View Controller (table 1)
  • Add New Motor (table 2)
  • show motor Detail (View 1)
  • edit Motor Detail (table 3) now what happens is i go to table 1 then click on add button then go to table 2 and add a new motor on table 1 when i click on row of table 1 i go to view 1 where my details are shown in the labels and wen i click the edit button on this view a edit screen pops up now when i edit here i wanna save these details back onto my view 1 how do i do it ?( im using storyboard and all views are connected through segue's ) (basically i want to do edit function so wen the the edit screen comes up i want to see the existing details in my text boxes n den i get to edit dem n den save them back)thank you
newstar7867
  • 17
  • 1
  • 8

1 Answers1

2

I have two answers for you.

  1. You need a permanent store for your data. Check out Apple's Core Data. They have documentation and an example. Also see RayWenderLick's Tutorial on Core Data. The answer is you will use Core Data to create a persistent store creating an sql database. The database will have an entity for motors. Each entry for the database will contain the detail for one motor. Each view controller (table) will access the database.

    This solution provides you with a persistent store. If your power the phone off and on again you will still have your data.

  2. A quick solution is to setup a delegate protocol which would allow the edit view controller to write data back to one of the other view controllers. Read Understanding Fundamental Design Patterns.

    This solution may get you past your immediate problems but does not provide a persistent store.

Community
  • 1
  • 1
T.J.
  • 3,942
  • 2
  • 32
  • 40
  • can i use nsnotification or blocks for this?? – newstar7867 Jan 08 '12 at 07:29
  • i want to build an app using storyboard in which i wanna populate my table n i wanna do all the add delete and update operations on my table so could anyone pls help as to how i go about this the textbook material what i have is all based on the old xcode n requires lot of outlets delegates and confusion so pls help thank you ------------------------------------------------------------------------ – newstar7867 Jan 09 '12 at 07:24