0

I have a store application, which I built by reading Big Nerd Ranch's iOS Programming, and I advanced my application to the another level and I have created another Item Detail View Controller. It is similar to iPhone's Settings.app, it is a table view controller. This table view consists 2 static table view cells with UITextField's. There is no problem about accessing this text fields, however I'm not able to save data taken from them. My table view controller has no idea about it's parent view controller (which is also another table view controller). So with basic - (void)viewWillAppear and - (void)viewWillDisappear methods I couldn't succeed save data. Having read some documentation about protocols and delegates, I couldn't help myself. Also I have no storyboards or .xib files. Just .h and .m files, may seem stupid but I hardcoded all of them. Ideas???

Let me show you what application looks like: enter image description here BNRDetailViewController

Buğra Ekuklu
  • 3,049
  • 2
  • 17
  • 28
  • Try using Singleton Object. You can play with one single object across multiple view. – Dhrumil Jul 01 '14 at 12:32
  • @iCoder I have a store object, which stores the BNRItems. It is singleton, can it help me? – Buğra Ekuklu Jul 01 '14 at 12:34
  • It isn't stupid at all, I think learning ios dev without storyboard is the best way... Do you have a "product" model/object? You should have one, then in prepareforsegue pass the entire object and modify in the modal view, also, you ahould have a mutableArray of products to populate the tableview, I'm heading now to work, there I can write some code for you – Fantini Jul 01 '14 at 12:36
  • Singletons can be used whenever you want the data to be stored and updated in a single object. It keeps a single instance which you can play with. So if you have specific data to be added/ removed, you can use singletons. – Dhrumil Jul 01 '14 at 12:42
  • @Fantini I have BNRItem (model object), BNRItemStore (store object), BNRItemsViewController (main view controller which shows items), BNRTableDetailViewController (modal view controller shows properties of a specific item). Also what is prepareforsegue? As I said, BNRItemStore is a singleton. – Buğra Ekuklu Jul 01 '14 at 12:50
  • This was a similar question: http://stackoverflow.com/questions/5210535/passing-data-between-view-controllers – Dániel Nagy Jul 01 '14 at 13:03

0 Answers0