Here, i have a NSMutableArray in my AppDelegate page, the array will be updated when the user add the values (user name) in the database. Now i want the array values(user name) to be displayed in the next view to be list out in the Picker View. I know there is more related questions is there, but i can’t find the solution. Any help appreciated.
Here is my code:
The array i have declared in the AppDelegate page, named jobarray, now i need to copy the items in the jobarray into next view, there i have declared pickerarray.
pickerarray = [[NSMutableArray alloc] initWithArray:appDelegate.jobarray copyItems:YES];
But it returns error message,
['NSInvalidArgumentException', reason: '-[Coffee copyWithZone:]: unrecognized selector sent to instance 0x822d410'] where 'Coffee' is my sqlite3 object file.
Your SQLite object does not conform to the NSCopying protocol – you haven’t implemented the
method. You can either implement this method to make your object copyable, but if you only need the copying for displaying, you’d better copy the array itself only:
this only retains the first array’s objects, no need to mess with implementing the copying protocol.