이 문제를 검색해 보았지만 잘못하고있는 것을 발견하지 못했습니다.목표 C 속성
다음#import <UIKit/UIKit.h>
@interface BabyLearnViewController : UIViewController {
UIButton *btnImage;
MediaManager* myMediaManager;
}
@property (nonatomic, retain) IBOutlet UIButton *btnImage;
@property (retain) MediaManager* myMediaManager;
- (IBAction)setNewImage;
@end
내 컨트롤러 클래스입니다 :
#import "BabyLearnViewController.h"
#import "MediaManager.h";
@implementation BabyLearnViewController
@synthesize btnImage;
@synthesize myMediaManager;
내가 오류를 얻고있다 :
error: expected specifier-qualifier-list before 'MediaManager'
error: no declaration of property 'myMediaManager' found in the interface
모든 아이디어를 여기
내 컨트롤러 헤더입니까? 일반적으로 1 차 오류는 원판 참조가있는 경우 나타납니다. 'MediaManager'는 다른 것을 참조하지 않습니다. 어떤 아이디어?
왜 순방향 선언을 선호합니까? –
@Rudy, forward 선언을 사용하면 헤더 사이의 순환 종속성에 돌입하지 않으며 헤더가 적어지면 컴파일 시간이 약간 향상 될 수 있습니다. – Vladimir
감사합니다. –