Updating a NSMutableArray in new viewController that's pushed onto the stack
<p>I'm new to programming and some OOP concepts and am not sure what is the "right" way to do something. Basically what I have is an NSMutableArray in my mainViewController.</p>

<pre><code>MainViewController: UITableViewController 

@property (nonatomic, retain) NSMutableArray *data;
</code></pre>

<p>A plus button can be pressed to add an item to the Table, or if an already existing row is selected, the current item can be edited.  I'm not sure what the best way to structure my DetailViewController since the DetailViewController can be presented from either the plus button or a table row selection.  Do I set a flag in DetailViewController that says which method presented the DetailViewController so in my Save method, I either insert the object (if the user pressed plus), or replace the object at the current index (if the user selected a row and I passed the index to the DetailViewController)?  It seems kind of clunky to do it that way and was wondering what a better way to do something simple like that would be.  Thanks!</p>
