我在此处代码中的实现 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;
Incomplete implementation
我的 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
有人知道怎么回事吗?
最佳答案
这只是意味着您还没有实现或定义您在头文件中编写的所有方法。如果您在实现文件中定义了每个 IBAction,这个错误就会消失。例如:
- (IBAction)tweetTapped:(id)sender {
//Do whatever you want it do do here
}
总的来说,错误警告只是意味着你需要定义一切。因为这只是一个警告,所以您的应用仍会构建并运行。
关于iphone - 不完整的@implementation Startscreen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8773461/