我正在尝试创建一个应用程序,当我按下警报视图打开时,我add button
在导航栏上的 table.m 文件中创建。此警报标题存储在数据库中,此标题显示在 UITableView 上。怎么表现?button
Enter name of alert title.
-(IBAction)Add:(id)sender
{
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"GPS Reminder?" message:@"Please Enter Reminder" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
text_field = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
text_field.placeholder=@"Enter Reminder";
[text_field becomeFirstResponder];
[text_field setBackgroundColor:[UIColor whiteColor]];
[myAlertView addSubview:text_field];
[myAlertView show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
{
if (buttonIndex == 1) {
[self validation];
NSString *str = [NSString stringWithFormat:@"insert into Worklist (userid,worktype) values ('%d','%@')",pkoflist,text_field.text];
NSLog(@"%@",str);
[Database executeQuery:str];
[self initilization];
}
}