iOS 개발을 완전히 처음 접했으니 나와 벗겨주세요. 다음objective-c의 인터페이스와 클래스 정의 간의 관계
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
가 AppDelegate.h에 의해 사용의 ViewController 인터페이스의 선언이 포함 ViewControllerTEST.h라는 파일입니다 :
다음
내 AppDelegate.h 파일입니다#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
내 질문 :
AppDelegate.hi에서 "@class ViewController"행을 사용할 때 컴파일러가 ViewController 인터페이스에 대한 선언을 찾을 위치를 어떻게 알 수 있습니까? 도망 갔어? 즉, 컴파일러는 ViewController 클래스에 대한 인터페이스가 ViewControllerTEST.h에 정의되어있을 때 AppDelegate.h에서 "@class ViewController"행을 실행할 때 어떻게 알 수 있습니까?
모든 설명을 크게 환영합니다!
그래서이 의미합니까 내부적 엑스 코드는 파일의 ViewController @class에서 클래스 이름과 일치 (즉, 처음에 만들) ViewController.h 이름? ViewController.h가 다른 이름으로 변경 되더라도? – BlueBucket7
그렇다면 내부적으로 어떻게 수행됩니까? 이것은 위험한 것 같습니다 ... 도와 줘서 고마워! – BlueBucket7