我试图通过引用(或指向对象的指针)将对象传递给另一个视图控制器 这就是我试图传递它的方式:
SecondViewController* ctrl = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil andParam:&self.sharedLocationHandler];
这是我在第二个视图控制器的初始化:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil andParam:(TTLocationHandler**)aParam {
[self.sharedLocationHandler.locationManager startUpdatingLocation];
return self;
}
我收到错误:
Address of property expression expected
我在这里做错了什么?
答案 0 :(得分:0)
您不能将指针传递给属性,因为属性本质上是getter-setter方法...将指针传递给变量... check this answer for more details