i have a Person classs
@interface Person : NSObject
@property (nonatomic, strong) NSString * name;
@property (nonatomic, strong) NSString * area;
@property (nonatomic, strong) int pin;
- (id) initWithName:(NSString *)anName andAreaName:(NSString *)anArea andPin:(int)aPin;
First i am reading a sqlite DB and fetching the a list of data i.e. name,area & pin.
Then i create an object of Person class & adding these fetched item in to it .Finally i add this object into an array.Now based on this array i am creating an table view & showing all these 3 data in different rows of a table view.
But now i have a Add New Name option is there on selection of which a pop up with text field will appear and on selection of submit option , a new row will be created with only name field in my table view.
So for this i have to update my old array or update initWithName: ?
Please guide me how to do this?
You can do this as follows,
Step 1:-
Create a Person object as follows,
You can later add
areaandpinas,Step 2:-
Add this to data source array of table,
Step 3:-