objective-c – 将AVAudioPlayerDelegate设置为self给我一个警告
发布时间:2020-12-16 06:59:40 所属栏目:百科 来源:网络整理
导读:'__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文件看
'__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上的另一个人有这个问题,这不是我得到它的原因 解决方法
因为void *是一个指向没有类型且不是真实对象的参数的指针,__strong不适用于它.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |