iphone - How to update the UI element of a Class A ie (UIViewController) from another class B ie (UIVIew) -
i trying change background color of class class b view-controller
, view type class not able this.
i know there have threading. have tried using performselectoronmainthread
method , few more nothing working me.
my code given below-
// in class b -(void)method{ classaviewcontroller *aview=[[classaviewcontroller alloc]init]; aview.imageindex=self.currentrenderingimageindex; [aview findindexofimage]; }
now calling class method
-(void)findindexofimage { nslog(@"print index %i",imageindex);// working fine aview.backgroundcolor=[uicolor bluecolor];// here not updating view. }
i know silly question asked here, please tell me should do.
simply call these lines class b:
baseviewcontroller *objbaseviewcontroller = [[baseviewcontroller alloc]initwithnibname:@"baseviewcontroller" bundle:[nsbundle mainbundle]]; [objbaseviewcontroller firstlink];
baseviewcontroller class name give here class name & firstlink method of class a. give here class method want call.
Comments
Post a Comment