我对此很陌生,所以请原谅我很容易修复错误
。H
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
@interface withadViewController : UIViewController <ADBannerViewDelegate>{
ADBannerView *banner;
BOOL bannerIsVisible;
IBOutlet UITextField *textField1;
IBOutlet UITextField *textField2;
IBOutlet UILabel *label1;
}
@property (nonatomic, assign)BOOL bannerIsVisible;
@property (nonatomic, retain)IBOutlet ADBannerView *banner;
-(IBAction)calculate;
-(IBAction)clear;
@end
.m(所有问题的原因不明)
#import "withadViewController.h"
@interface withadViewController () HERE IT SAYS INCOMPLETE IMPLEMENTATION
@end
@implementation withadViewController
@synthesize banner;
@synthesize bannerIsVisible;
-(void) bannerViewDidLoadAd:(ADBannerView *)banner {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOn" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, 50.0); HERE SAYS LOCAL DECLARATION OF BANNER HIDES INSTANCE VARIABLE
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
-(void)bannerView:(ADBannerView *)aBanner didFailToReceiveAdWithError:(NSError *)error {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, -320.0);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
-(IBAction)calculate { HERE IT SAYS EXPECTED EXPRESSION
int x = ([textField1.text floatValue]);
int c = x*([textField2.text floatValue]);
label1.text = [[NSString alloc]initWithFormat:@"%2d", c];
}
-(IBAction)clear {
textField1.text = @"";
textField2.text = @"";
label1.text = @"";{
}
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end HERE IT SAYS MISSING @END
这是所有 .h 和 .m 文件