일부 사람들이 .m 파일에서 메소드를 선언하는 이유를 이해하지 못합니다. 그 선언은 .h 파일에 대신 들어갈 수 없습니까? 여기에 내가 주로 볼 수있는 작업은 다음과 같습니다.h 파일과 .m 파일에서 @interface 및 @end를 지정하는 메소드의 차이점
//myClass.h
#import <UIKit/UIKit.h>
@interface myClass: UIViewController
{
}
@end
및 구현 (하는 .m) 부분 :
//myClass.m
#import "myClass.h"
@interface myClass
//declare some methods here
@end
@implementation myClass
//the actual implementation
@end
방법이 방법을 선언 어떤 차이가 있습니까? 또한 "@private"메서드는 myClass.h 자체에서 선언 할 수 있습니까?
가능한 중복 [.h와 .m 파일의 @interface 정의 간의 차이] (http://stackoverflow.com/questions/3967187/difference-between-interface-definition-in-h-and-m-file)) –