Objective-C에서 friend 클래스와 같은 것을 만들 수있는 방법이 있습니까?Objective-C의 친구 클래스
// VisualNotePlayer+Views.h
@interface VisualNotePlayer(Views)
@property (nonatomic, retain) UIView *currentView;
@end
이 인터페이스는 VisualNotePlayer+Views.h
를 가져 사람들 만 액세스 할 수 있습니다 :
// VisualNotePlayer.h
@interface VisualNotePlayer : NSObject<NotePlayer>{
@private
UIView *_currentView;
}
// VisualNotePlayer.m
@interface VisualNotePlayer()
@property (nonatomic, retain) UIView *currentView;
@end
@implementation VisualNotePlayer
@synthesize currentView=_currentView;
...
@end
그런 다음 범주의 속성을 다시 :
아 ... 그래서 동일한 클래스에 대해 여러 개의 .h 파일을 효과적으로 가져야합니다. –