0

我有这个代码:

@class GADBannerView,GADRequest;

@interface BT_viewController : UIViewController <UIAlertViewDelegate, 
                                                ADBannerViewDelegate,
                                                UIAccelerometerDelegate,
                                                MFMailComposeViewControllerDelegate,
                                                MFMessageComposeViewControllerDelegate,
                                                GADBannerViewDelegate>{
    BT_item *screenData;
    UIView *progressView;
    GADBannerView *bannerView_;
    /* iAd Views */
    UIView *adView;
    ADBannerView *adBannerView;
    BOOL adBannerViewIsVisible;
    BOOL hasStatusBar;
    BOOL hasNavBar;
    BOOL hasToolBar;

}



@property (nonatomic, retain) BT_item *screenData;
@property (nonatomic, retain) UIView *progressView;
@property (nonatomic, retain) UIView *adView;
@property (nonatomic, retain) ADBannerView *adBannerView;
@property (nonatomic) BOOL adBannerViewIsVisible;
@property (nonatomic) BOOL hasStatusBar;
@property (nonatomic) BOOL hasNavBar;
@property (nonatomic) BOOL hasToolBar;

-(id)initWithScreenData:(BT_item *)theScreenData;


-(void)showProgress;
-(void)hideProgress;
-(void)navLeftTap;
-(void)navRightTap;
-(void)showAudioControls;
-(void)showAlert:(NSString *)theTitle theMessage:(NSString *)theMessage alertTag:(int)alertTag;
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

//iAd methods...
-(void)createAdBannerView;
-(void)resizeAdView;
-(void)showHideAdView;
-(void)bannerViewDidLoadAd:(ADBannerView *)banner;
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error;

//shake capture...
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event;

//message compose delegate methods...
-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result;
-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error;



//rotation methods...
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation;

@property(nonatomic, strong) GADBannerView *bannerView;
- {GADRequest *}createRequest;

@end

我不知道为什么在这一行:

- {GADRequest *}createRequest;

它给出了一个错误:“Objective-C 方法的预期选择器”但是如果我删除该行上方的一些代码就可以了。你能弄清楚这里的错误是什么吗?抱歉,因为我是新手,所以我对错误消息的含义感到非常困惑。谢谢你。

4

1 回答 1

4

我相信您正在尝试声明一个实例方法。更改如下。

- (GADRequest *)createRequest; //To This

- {GADRequest *}createRequest; //From this
于 2013-09-02T04:17:02.183 回答