Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 第一个UITableViewCell未调用DidSelectRowatineXpath_Ios_Objective C_Uitableview_Didselectrowatindexpath - Fatal编程技术网

Ios 第一个UITableViewCell未调用DidSelectRowatineXpath

Ios 第一个UITableViewCell未调用DidSelectRowatineXpath,ios,objective-c,uitableview,didselectrowatindexpath,Ios,Objective C,Uitableview,Didselectrowatindexpath,当我选择一个UITableViewCell时,最奇怪的事情发生了 如果我选择第一个,它不会做任何事情,但是当我选择第二个时,它会调用didSelectRowAtIndexPath方法,但是使用第一个的值 我应该提到的是,我使用的是一个UIViewController,里面有一个UITableView。我还应该提到,我刚刚开始使用IOS 7 这是我的密码 ChannelsPoOverviewController.h @interface ChannelsPopoverViewController

当我选择一个
UITableViewCell
时,最奇怪的事情发生了

如果我选择第一个,它不会做任何事情,但是当我选择第二个时,它会调用
didSelectRowAtIndexPath
方法,但是使用第一个的值

我应该提到的是,我使用的是一个
UIViewController
,里面有一个
UITableView
。我还应该提到,我刚刚开始使用IOS 7

这是我的密码

ChannelsPoOverviewController.h

@interface ChannelsPopoverViewController :UIViewController <UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *channelsTableView;

@end

首先

[cellLabel.text isEqual:@“添加dropbox”]

应该是

[cellLabel.text isEqualToString:@“添加dropbox”]

其次

您应该在
didSelectRowAtIndexPath
方法中真正使用
indepath

例如:


首先

[cellLabel.text isEqual:@“添加dropbox”]

应该是

[cellLabel.text isEqualToString:@“添加dropbox”]

其次

您应该在
didSelectRowAtIndexPath
方法中真正使用
indepath

例如:


您使用的是DidDeceloseRowatineXpath,而不是DidSelectRowatineXpath。

您使用的是DidDeceloseRowatineXpath,而不是DidSelectRowatineXpath。

未调用DidSelectRowatineXpath()的常见原因是在viewcontroller上有一个UITapGestureRecograizer,将“视图中的取消触摸”设置为“是”

正确且唯一合理的解决方法是将“视图中的取消触摸”设置为“否”。那么您的表行选择应该可以很好地工作

显然,这在手势处理程序中有一些含义-您可能需要向手势处理程序中添加一些代码,以阻止对视图进行某些触摸,例如

- (IBAction)onTapGesture:(UITapGestureRecognizer *)sender {

    if (sender.view == someOldViewThatINeedToDealWith) {
        sender.cancelsTouchesInView = true;
    }
}

didSeletRowAtIndexPath()未被调用的常见原因是在viewcontroller上有一个UITapgestureRecognitizer,其“取消视图中的触摸”设置为“是”

正确且唯一合理的解决方法是将“视图中的取消触摸”设置为“否”。那么您的表行选择应该可以很好地工作

显然,这在手势处理程序中有一些含义-您可能需要向手势处理程序中添加一些代码,以阻止对视图进行某些触摸,例如

- (IBAction)onTapGesture:(UITapGestureRecognizer *)sender {

    if (sender.view == someOldViewThatINeedToDealWith) {
        sender.cancelsTouchesInView = true;
    }
}

你怎么知道没有加载。尝试添加NSLog(@“行:%d”,indexath.Row);要取消rowatinexpath:。替换isEqual:to isEqualToString。您正在使用的是DidDescelectRowatineXpath,而不是DidSelectRowatineXpath。您如何知道未加载。尝试添加NSLog(@“行:%d”,indexath.Row);要取消rowatinexpath:。替换isEqual:to IseQualtString。你正在使用DidDescelectRowatindexpath,而不是DidSelectRowatindexpath。是的,我也遇到过。是的,我也遇到过。哦,上帝。我的
UITableViewController
的表视图上确实有一个
uitappesturerecognizer
,这样当用户点击单元格外部时,键盘就会被关闭。该死的苹果,我怎么知道这些?谢谢你的帮助。哦,上帝。我的
UITableViewController
的表视图上确实有一个
uitappesturerecognizer
,这样当用户点击单元格外部时,键盘就会被关闭。该死的苹果,我怎么知道这些?谢谢你的帮助。
- (IBAction)onTapGesture:(UITapGestureRecognizer *)sender {

    if (sender.view == someOldViewThatINeedToDealWith) {
        sender.cancelsTouchesInView = true;
    }
}