私はこれに非常に慣れていないので、間違いを修正しやすいことをお許しください
.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 ファイルのすべてです。