Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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
iOS6 XCode4.6.2通过序列传递行号_Ios6_Xcode4_Nsindexpath - Fatal编程技术网

iOS6 XCode4.6.2通过序列传递行号

iOS6 XCode4.6.2通过序列传递行号,ios6,xcode4,nsindexpath,Ios6,Xcode4,Nsindexpath,如果我通过序列将数据传递给另一个视图控制器,例如 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"mySequeIdentifier"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];

如果我通过序列将数据传递给另一个视图控制器,例如

 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
     if ([segue.identifier isEqualToString:@"mySequeIdentifier"]) {
         NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
         RecipientViewController *destViewController = segue.destinationViewController;
         destViewController.intPassedRow = indexPath.row;
    }
 }
这将传递正确的行号,但

我得到一个错误,说“不兼容的整数到指针转换从'int'分配到'int'


如果它们都是int,那么我做错了什么?

它们不都是
int
s。您可能将您的
intPassedRow
声明为指向
int
的指针,而实际上您正在传递一个
int
。我相信您是正确的-我如何协调这一点?请发布您财产的确切声明
intPassedRow
,以验证我的怀疑,然后我可以告诉您要更改什么。@property int*passedRownNumber;NSString*strPasseDrinkNumber=[NSString stringWithFormat:@“%d”,passedLownNumber];第二行生成黄色警告,数字正确,但显然不正确。非常感谢。密码前的*表示它是一个指针。去掉它,它应该会工作。