Iphone 带有UILocalNotification和DetailViewController的TableView
你能帮我查一下这个密码吗? 我正在做一个应用程序,你可以添加UIlocalNotifications,这些通知会进入tableView 但是我不知道怎么做下面的一个: 当我在某一行中单击时,我希望类DetailViewController获取“notification.alertbody”.text,并作为标签放置在DetailViewController上。 有人能帮我吗 这不管用Iphone 带有UILocalNotification和DetailViewController的TableView,iphone,notifications,tableview,uilocalnotification,Iphone,Notifications,Tableview,Uilocalnotification,你能帮我查一下这个密码吗? 我正在做一个应用程序,你可以添加UIlocalNotifications,这些通知会进入tableView 但是我不知道怎么做下面的一个: 当我在某一行中单击时,我希望类DetailViewController获取“notification.alertbody”.text,并作为标签放置在DetailViewController上。 有人能帮我吗 这不管用 - (void)tableView:(UITableView *)tableView didSelectRowA
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UILocalNotification *notification = [self.notificationsArray objectAtIndex:indexPath.row];
DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
[dvController.nomeMedicamento setText:[notification alertBody]];
[self.navigationController pushViewController:dvController animated:YES];
[dvController release];
}
其中,“nomeMedicamento”是@属性(非原子,保留)IBUILabel*nomeMedicamento;从DetailViewController
我添加通知的类具有以下方法:
- (void)addNotification {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = self.datePicker.date;
localNotification.alertBody = self.messageField.text;
.
.
.
}
我想要这个messageField.text
谢谢,我为我的英语感到抱歉 你写“这不管用!”是什么意思 你的方法没有被调用?您的变量没有传递?您的viewController是否未按下 您是否检查了
alertBody
的内容
[dvController.nomeMedicamento setText:[notification alertBody]];
NSLog(@"nomeMedicamento = %@", dvController.nomeMedicamento.text);