我正在执行以下操作将viewcontroller(piechartController)初始化为viewcontroller(covVC)变量,如下所示......是否更改视图控制器变量?
self.pie = [[ChatController alloc] initWithNibName:@"Chat" bundle:nil];
self.covVC = [[coverAssetController alloc] init];
self.covVC.pieObj = self.pie;
coverAssetController.h ------>
@interface coverAssetController : UIViewController {
ChatController *pieObj;
}
答案 0 :(得分:1)
您需要在coverAssetController中添加一个属性:
@interface coverAssetController : UIViewController {
PieChartController *pieObj;
}
@property(nonatomic, assign) PieChartController *pieObj;
在你的实现中添加:
@synthesize pieObj;
无论如何,这样做是可以的^^ 但事实上,这取决于你想做什么等等。