ios - suggestions on how i can resolve this "Semantic Issue" error -


i have been trying implement iad 1 of view controllers , after writing code both .h , .m file.... semantic issue error:

@synthesize of 'weak' property allowed in arc or gc mode 

i error right next @implementation of .m file. suggestions on how can resolve appreciated.

also wondering whether ok copy , paste adbanner(once working) viewcontroller onto other view controllers withot re-coding ?

this code iad within .h file

#import <uikit/uikit.h> #import <iad/iad.h>  @interface viewcontroller : uiviewcontroller <adbannerviewdelegate> @property (weak, nonatomic) iboutlet adbannerview *banner;  @end 

this code iad within .m file

#import "viewcontroller.h"  @interface viewcontroller ()  @end  @implementation viewcontroller  - (void)viewdidload { [super viewdidload]; self.banner.delegate = self; }  - (void) viewdidlayoutsubviews { if (self.banner.bannerloaded) {     cgrect contentframe = self.view.bounds;     cgrect bannerframe = self.banner.frame;     contentframe.size.height -= self.banner.frame.size.height;     bannerframe.origin.y = contentframe.size.height;     self.banner.frame = bannerframe; } }  - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. }  - (bool)bannerviewactionshouldbegin:(adbannerview *)banner willleaveapplication:    (bool)willleave { nslog(@"bannerviewactionshouldbegin"); return yes; }  - (void)bannerviewdidloadad:(adbannerview *)banner { nslog(@"bannerviewdidloadad"); }  - (void)bannerview:(adbannerview *)banner didfailtoreceiveadwitherror:(nserror *)error { nslog(@"didfailtoreceiveadwitherror"); }  - (void)bannerviewactiondidfinish:(adbannerview *)banner { nslog(@"bannerviewactiondidfinish"); }  @end 

you enable arc going edit pressing refactor , convert objective-c arc.


Comments