我有以下UIViewController類:從UIViewController中傳遞的值的UIView
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;
然後我有我的UIView類名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;
...
=====
問:
我該怎麼辦從我的UIViewController傳遞名稱的值並將其分配給變量receivedName在我的UIView?
UIView的情節是在我的UIViewController DataViewController
'plotGraph.receivedName = self.name'; – beryllium