から値を読み書きしようとしていますAppDelegate
。私は例外を持ってしまう
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate myViewDelegate]: unrecognized selector sent to instance 0xc07a9b0'
のAPPDelegate.h
@interface AppDelegate : NSObject <UIApplicationDelegate> {
MyView *myViewDelegate;
}
@property (nonatomic,strong) MyView *myViewDelegate;
のAPPDelegate.m
- (void) _application:(UIApplication *)application commonInitializationLaunching:(NSDictionary *)launchOptions{
...
self.myViewDelegate = [[MyView alloc] init];
}
MyView.h
私はNSDate *d;
@property(nonatomic,strong) NSDate *d;
そして@synthesis d;
_MyView.m
のPaymentView.m
- (void) loadView{
[super loadView];
AppDelegate *del=(AppDelegate *)[[UIApplication sharedApplication] delegate];
del.myViewDelegate.d = myDate;// myDate is a NSDate
}