こんにちは、アプリの delegate.m のメソッドに nsnotifiaction を割り当て、このメソッドは 30 秒ごとに eprox を呼び出します。viewcontroller と execute メソッドでその通知が必要です。これが appdelegate .m の私のコードです。
- (void)layoutAnimated:(BOOL)animated{
BOOL yy= self.bannerView.bannerLoaded;
if (yy==1){
self.iAdString=[NSMutableString stringWithString:@"1"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"BannerViewActionWillBegin" object:self];
}
else{
self.iAdString=[NSMutableString stringWithString:@"0"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"BannerViewActionDidFinish" object:self];
}
}
そしてviewcontroller.mで
//viewdidload メソッドで定義されている
- (void)viewDidLoad{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willBeginBannerViewActionNotification:) name:@"BannerViewActionWillBegin "object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didFinishBannerViewActionNotification:) name:@"BannerViewActionDidFinish" object:nil];
}
その方法は..
- (void)willBeginBannerViewActionNotification:(NSNotification *)notification{
[self.view addSubview:self.app.bannerView];
NSLog(@"come");
}
- (void)didFinishBannerViewActionNotification:(NSNotification *)notification {
NSLog(@"come");
[self.app.bannerView removeFromSuperview];
}
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
メソッドがappdelegateファイルで読み込まれている間、超過したメソッドの応答がありません。
私を助けてください。