hello everybody.
have tabbarcontroller project , put uiwebview on first controller.
it's working except didfailloadwitherror.
here code
myappfirstviewcontroller.h
code:
#import <uikit/uikit.h> @interface myappfirstviewcontroller : uiviewcontroller <uiwebviewdelegate> @property (weak, nonatomic) iboutlet uiwebview *my_uiwebview; @end
myappfirstviewcontroller.m
code:
#import "myappfirstviewcontroller.h" @interface myappfirstviewcontroller () @end @implementation myappfirstviewcontroller @synthesize my_uiwebview; -(void)my_uiwebview:(uiwebview *)my_uiwebview didfailloadwitherror:(nserror *)error { nslog(@"error uiwebview"); uialertview *alert = [[uialertview alloc] initwithtitle:@"error" message:@"connection error" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. } - (void)viewdidunload { [self setmy_uiwebview:nil]; [super viewdidunload]; // release retained subviews of main view. } - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { return (interfaceorientation != uiinterfaceorientationportraitupsidedown); } - (ibaction)play {......etc..... } @end
cannot understand why (for example in aereomode) not enter in code:
-(void)my_uiwebview:(uiwebview *)my_uiwebview didfailloadwitherror:(nserror *)error
thank 
p.s have same problem iad , code:
-(void)bannerviewdidloadad:(adbannerview *)banner { , code:
-(void)bannerview:(adbannerview *)banner didfailtoreceiveadwitherror:(nserror *)error
p.s. using xcode 4.3
are sure you've set delegate uiwebview?
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment