'__strong' only applies to objective-c object or block pointer types; type here is 'void *'
这是我的 AVAudioPlayer.h 文件中的“__strong”行(这是一个导入的框架)
@interface AVAudioPlayer : NSObject {
@private
__strong void *_impl;
}
我的 .h 文件看起来像这样
#import <UIKit/UIKit.h>
#import <AVFoundation/AVAudioPlayer.h>
@interface excerViewController : UIViewController <AVAudioPlayerDelegate,UIAccelerometerDelegate>
@property (weak, nonatomic) IBOutlet UILabel *avgLabel;
@property (weak, nonatomic) IBOutlet UILabel *modeLabel;
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIButton *playButton;
@property int subScore;
@property int score;
@property int seconds;
@property int moments;
@property NSMutableString *average;
@property double avg;
@property BOOL locked;
@property double delta;
@property UIAccelerometer *accel;
@property AVAudioPlayer *player;
-(void)drawEnergy:(double)energy;
@end
我一生都无法弄清楚为什么会出现此错误。StackOverflow 上的另一个人有这个问题,这不是我得到它的原因('__strong' 仅适用于objective-c 对象或块指针类型;这里的类型是 XXX" 警告)