Любые идеи ? некоторый пример кода или некоторые советы будут приветствоваться... спасибо
// add bank to tableView
-(void)addBankFromList {
if (notInList == nil) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Could not be added" message:@"Bank already in list" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
else {
// [banksTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[banks count] inSection:0]] withRowAnimation:UITableViewRowAnimationLeft];
// [banksTableView reloadData];
}
}
// call addBankFromList method when button Add to List is touched .
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
[self addBankFromList];
}
#pragma mark UIPicker Delegate and DataSource methods
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
for (NSString *temp in banksNotInList)
if (temp == [arrayWithBanks objectAtIndex:row]) {
notInList = [[NSMutableString alloc]initWithString:temp];
NSLog(@"%@",temp);
}
else notInList = nil;
}
РЕШЕНО (прочитайте первый комментарий)
[appDelegate.banks insertObject:notInList atIndex:[appDelegate.banks count]];
[banksTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[banks count] inSection:0]] withRowAnimation:UITableViewRowAnimationLeft];
[banksTableView reloadData];