【发布时间】:2014-04-28 10:15:12
【问题描述】:
谁能帮帮我...我有一个集合视图,它显示从 SQLite 数据库检索到的数据。集合视图单元格中的某些文本字段需要使用弹出窗口中的预定义列表进行更新。
弹出框显示正确的值,我确实检索了选定的值,但我无法用该值更新集合视图中的文本字段。我假设我需要在启动 segue 时使用 indexpath 指定包含文本字段的单元格,但我不知道如何。
我使用这个来启动弹出窗口:
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
if (textField.tag == 101) {
Global.Table = @"Access";
Global.Code = @"G";
Global.Request = @"Access";
[self performSegueWithIdentifier:@"PopUp" sender:self];
return NO;
}
else {
return YES;
}
}
在表格视图中选择正确的值后弹出框会发送通知并被关闭。
- (void)receivedNotification:(NSNotification *) notification {
if ([[notification name] isEqualToString:@"scroller"]) {
if ([Global.Request isEqualToString:@"Access"]) {
NSLog(@"Returnvalue is %@",Global.Value);
//this is where the problem arises, I cannot access the text field to update the value, the return value is correct.
[self.collectionviewManagement selectItemAtIndexPath:0 animated:NO scrollPosition:0];
WDSCellManagement *cell = [_collectionviewManagement dequeueReusableCellWithReuseIdentifier:@"CellManagement" forIndexPath:0];
cell.AccessPersons.text = Global.Value;
}
}
}
非常感谢您的帮助!
【问题讨论】:
标签: ios7 uicollectionview uicollectionviewcell