[英]Declaring a property
I am trying to declare a property 我正在尝试申报财产
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
@interface ViewController : UIViewController
{
@property (nonatomic, strong) MPMoviePlayerController*player;
}
@end
I receive a red warning sign when i click on it, it reads; 当我单击它时,我会收到一个红色警告标志,它显示为;
a parameter list without types is only allowed in function definition 没有类型的参数列表仅在函数定义中允许
properties are outside of braces 属性不在大括号内
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
@interface ViewController : UIViewController
{
// here is for ivars only
id _something;
}
// properties and methods
@property (nonatomic, strong) MPMoviePlayerController*player;
@end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.