iphone - Passing Parameter From a View Back To another View's UITableView's Cell -
i have got 2 view. first: firstviewcontroller second: secondviewcontroller
firstviewcontroller uinavigationcontroller's root controller , inside firstviewcontroller ve got uitableview. when cell clicked in uitableview, view navigated secondviewcontroller. inside secondviewcontroller have uilabel. want assign uilabel's value cell clicked @ firstviewcontroller when button clicked in navigation bar. supposed implement this?
i can pass value secondviewcontroller firstviewcontroller creating:
secondviewcontroller *sv; sv.somestring = someanotherstring;
but can not implement @ secondviewcontroller pass value nsstring in firstviewcontroller.
can u me please?
thank you. ae
ya , there easy way handle this.....
you can take global variable
in delegate.h file declare variable:
@interface smoke_applicationappdelegate : nsobject { uiwindow *window; uinavigationcontroller *navigationcontroller; nsstring *messagestring; //this string variable } @property(nonatomic,retain)nsstring *messagestring;
secondly in delegate.m file
@implementation smoke_applicationappdelegate @synthesize window; @synthesize navigationcontroller; @synthesize messagestring; // synthesize on here..
this done .now can use string variable in all/any class want..
to use global variable.
just import delegate file make obj of it....
import "delegatefile.h" @implementation delegatefile *appdel;
now in class.m
-(void)viewdidload { [super viewdidload]; appdel=[[uiapplication sharedapplication]delegate]; }
now can access anywhere in class object:
appdel.messagestring
just follow steps , sure going you.....
have easy life,
Comments
Post a Comment