在我的應用程序我有復位按鈕,刪除表中的所有數據,並刪除database.but之前,我必須把警報視圖,並提出這樣的問題如下:警報視圖的方法是行不通的
- (IBAction)resetData:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Bills Data Entry"
message:@"Are you sure want to reset data?" delegate:nil
cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
[self databaseOpen];
NSString *deleteData=[NSString stringWithFormat:@"delete from tbl_Bills"];
[database executeQuery:deleteData];
NSLog(@"inert query: %@",deleteData);
NSLog(@"records deleted");
[table reloadData];
[database close];
// DO STUFF
}
}
這當我點擊是時,方法不會被調用。
你使用斷點,以確保程序進入方法? – Joze
設置代表自我... – Maulik