开发者

initializing viewcontroller(piechartController) to viewcontroller's(covVC) variable

开发者 https://www.devze.com 2023-01-17 23:17 出处:网络
i am doing the following to initialize the viewcontroller(piechartController) to the viewcontroller\'s(covVC) variable like f开发者_运维知识库ollowing …is it right to change the view controller varia

i am doing the following to initialize the viewcontroller(piechartController) to the viewcontroller's(covVC) variable like f开发者_运维知识库ollowing …is it right to change the view controller variable ?

  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;
 }


You need to add a property in your coverAssetController :

 @interface coverAssetController : UIViewController {

    PieChartController *pieObj;

 }
@property(nonatomic, assign) PieChartController *pieObj;

And in you implementation add :

@synthesize pieObj;

Anyway, it's ok to do it ^^ But in fact it depends what you want to do etc etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号