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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -