iphone - Passing a value from UIViewController to UIView -
i have following uiviewcontroller class:
file: resultsdataviewcontroller.h
@interface resultsdataviewcontroller : uiviewcontroller @property (nonatomic, strong) nsstring* name; @end file : resultsdataviewcontroller.m
#import "resultsdataviewcontroller.h" @interface resultsdataviewcontroller () @end @implementation resultsdataviewcontroller @synthesize data; then have uiview class name plot.h/m
plot.h:
@interface plotgraph : uiview <cptbarplotdatasource, cptbarplotdelegate> @property (nonatomic, strong) nsstring* receivedname; @end plot.m:
#import "plot.h" @interface plot() @end @implementation plotgraph @synthesize receivedname; ...
=====
question:
how pass value of name uiviewcontroller , assign variable receivedname in uiview?
the uiview plot view in uiviewcontroller dataviewcontroller
(note: @synthesize data; in question typo. i'll assume meant @synthesize name;. also, @interface plot() should @interface plotgraph().)
first, need have reference plotgraph object either create in code or load iboutlet variable xib file or storyboard. once have that, either create or in viewdidload:, it's like:
plotview.receivedname = self.name;
Comments
Post a Comment