宣布财产

时间:2014-03-25 02:44:40

标签: ios objective-c

我正在尝试申报一个属性

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>

@interface ViewController : UIViewController
{
@property (nonatomic, strong) MPMoviePlayerController*player;
}


@end

当我点击它时,我收到一个红色警告标志,它显示;

只有函数定义

才允许没有类型的参数列表

1 个答案:

答案 0 :(得分:0)

属性不在大括号中

#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