Я объявил NSArray в моем .h
@interface DevicePreferencesController : UITableViewController < UIAlertViewDelegate >{
NSArray *plist;
UITextField *deviceName;
}
Этот массив используется для загрузки данных plist с URL
, и это список, который я получил
plist:(
{
category = 11;
id = 1;
name = light1;
},
{
category = 11;
id = 5;
name = window;
},
{
category = 12;
id = 2;
name = dimmer2;
},
{
category = 23;
id = 3;
name = win;
}
)
Я показываю его с помощью tableView
и, если я выбрал ячейку
, появится всплывающее окно alertView с textField, оно может переименовать данные в plist
А вот действие кнопки для alertView
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if ([alertView tag]==1) {
if (buttonIndex == 1){
[request setPostValue:[[self.plist objectAtIndex:indexPath.row] valueForKey:@"id"] forKey:@"id"];
[request setPostValue:deviceName.text forKey:@"name"];
[request startSynchronous];
}
}
}
Но я получил ошибку здесь "indexPath" undeclared !
Почему?plist это массив, почему я не могу получить indexPath из массива ???