objective c - How to share information across controllers? -
i started programming first cocoa app. have ran problem hope can me with.
i have maincontroller controls user browsing computer , sets textfield = chosen folder.
i need retrieve chosen folder in analyzecontroller in order work. how pass textfield objectvalue maincontroller analyzecontroller?
thanks
alright came with:
maincontroller.h: #import "analyzecontroller.h" @interface maincontroller : nsobject { analyzecontroller* analyzecontrol; } maincontroller.c: analyzecontrol = [[analyzecontroller alloc]init]; [analyzecontrol setdevelopmentpath:filename]; analyzecontroller.h: @interface analyzecontroller : nsobject { nsstring* developmentpath; } @property(assign) nsstring* developmentpath; analyzecontroller.c: @synthesize developmentpath; nslog(@"final test: %@", developmentpath);
but end test returning null. bit unsure property parameter should be. can help? or did wrong?
how pass textfield objectvalue maincontroller analyzecontroller?
do that.
[analyzecontroller setfolderpath:self.mainfolderpath];
i assume either bound text field mainfolderpath
property, or assigned property when field's value changed.
i assume that, in writing analyzecontroller, gave property named folderpath
or @ least setter named setfolderpath:
.
Comments
Post a Comment