开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜