Quote:
Originally Posted by alexgiul
I think I should manage into method "cellForRowAtIndexPath" but I don't what I should do
|
1. In -
Code:
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
method add one to current value in ex. if you have
return [dataArray count] change it to return [dataArray count]+1;
2. In -
Code:
(UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
when indexPath.row < [dataArray count] put your normal code and when
indexPath.row = [dataArray count] add code like here:
Code:
cell.text = "Add New item";
3. In -
Code:
(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
add code like here:
Code:
if (indexPath.row == [dataArray count]) {
style = UITableViewCellEditingStyleInsert;
}