我在这里的代码中收到了关于执行Topscore行的警告:
#import <Twitter/Twitter.h>
#import <GameKit/GameKit.h>
#import <AVFoundation/AVAudioPlayer.h>
#import <AudioToolbox/AudioServices.h>
@interface Topscore ()
@property (strong, nonatomic) NSString *imageString;
@property (strong, nonatomic) NSString *urlString;
- (void)clearLabels;
@end
@implementation Topscore // Warning on this line
@synthesize count, date, urlString = _urlString, imageString = _imageString, delegate, Topscore, currentLeaderBoard, earnedAchievementCache;
不完整的实施
我的startscreen.h头文件看起来像这里的代码:
@interface Startscreen : UIViewController <AVAudioPlayerDelegate> {
AVAudioPlayer *audioPlayer;
}
- (IBAction)tweetTapped:(id)sender;
- (IBAction) startgame;
- (IBAction) showLeader;
- (IBAction) subScore;
- (IBAction) showLeader;
- (IBAction) addScore;
- (IBAction) settings;
-(IBAction)playSound:(id)sender;
-(IBAction)pause:(id)sender;
-(IBAction)stopmusic;
@end
有谁知道什么是错的?
答案 0 :(得分:2)
这只是意味着您尚未实现或定义在头文件中编写的所有方法。如果在实现文件中定义每个IBAction,则此错误将消失。例如:
- (IBAction)tweetTapped:(id)sender {
//Do whatever you want it do do here
}
总的来说,错误警告只是意味着您需要定义所有内容。因为它只是一个警告,你的应用程序仍然会构建并运行。