ios - get some Error with creating and inserting object of array -


I am new to iPhone and now I am struggling to create and insert objects. I'll explain first here

Here I have a tableview with some cell move which is going to my array, whose name is appDelegate.array1 I now see something in the table view cell I can change the value and now after that I want to include this new cell value in the same array app Delegate.array1. So how can I do this I tried to do it.

  - (void) ViewViewPaper: (BOOL) animated {[appDelegate.array1 addObject: indexPath]; [Reload tableview data]; }   

whether it is correct or not, if yes then why my application will end and if not, please give me the correct method to add an object to the array

Note this point.

1) Check if your array is a mutant array ... then only you can add new items to the array at run time 2) What is the index path in your code, which is a bit confusing .. < / P>

3) To add an object you use these (or more) functions

  [yourArray addObject: your_object];   

Or you can use

  [yourArray insertObject: your_object atIndex: your_index] to enter the array;   

Hope for this help

Comments