表视图推送到新视图 XIB
我创建了一个表视图,从数组中提取其单元格。
每个单元格都需要推送到不同的视图......并且我找不到被点击的单元格的值。它需要一个条件语句,但没有值我无法推送视图:(
下面是我的 didSelectRowAtIndexPath 的片段
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
if(){
SendSms *detailViewController = [[SendSms alloc] initWithNibName:@"SendSms" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
}
您将看到 If 语句为空...我需要推送列的值以推送到另一个视图控制器。
请帮忙!
I have created a table view that pulls its cells from an array.
Each cell needs to push to a different view... and I cannot find the value of the tapped cell. It needs a conditional statement but without the value i cannot push the view :(
below is the snippet of my didSelectRowAtIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
if(){
SendSms *detailViewController = [[SendSms alloc] initWithNibName:@"SendSms" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
}
You will see the If statement is blank... I need the value of the column pushed to push to another view controller.
Please help! Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我将为那些可能正在寻找它的人回答我自己的问题,因为我刚刚解决了:)
使用:
希望这可以帮助有同样问题的人
I'll answer my own question for those who may be searching it out since i just worked it out :)
use:
Hope that might help someone with the same problem
即使在乔纳森的回答之后,我还是建议使用这个,最好使用
如果您正在比较字符串,您应该使用 isEqualToString 方法。
Even after Jonathan's answer I recommend to use this, It would be better to use
If you are comparing string you should use isEqualToString method.
您可以找到被点击的单元格的值,例如
indexpath.row,
当用户触摸任何单元格值时,indexpath.row将为您提供一个数字,然后您可以执行一些操作,例如
希望这能解决您的问题。
you can find the value of the tapped cell like
indexpath.row,
when user will touch any cell values the indexpath.row will provide you a number then you can perform some actions like
Hope this will solve your problem.