So I have seen a few tutorials out there on how to do this but really they all involve hard-coding buttons and text fields in. What I have done is created a view controller A
, with an embedded table view. And in the navigation bar I have added a button (the "Add") plus symbol button. This button I have made its action to modally bring up another view controller B
where I have a text field and a button Save
.
Here is a picture for reference:
So what I want to do, is have the user be able to press the green plus button in view controller A
, and then it will bring up view controller B
where I can enter a username, press save, and it will dismiss itself (I know how to do this) and reveal A
again but now showing the newly added contact.
I am using an NSMutableArray to store and populate the table. What is the simplest, and easiest way in which I can do this, without having to hardcode buttons in as shown in the apple docs Table View Programming Guide. I have two separate classes for A
I have the Contacts
class and for B
I have designated it the addContact
class. Both classes are simply view controller subclasses.