Xcode에 NSObject 클래스가 있고 @implementation 줄에서 오류가 발생합니다. 'initWithName : tutorID : tutorPhone : tutorEmail :'에 대한 메소드 정의가 없습니다.'initWithName ...'에 대한 메소드 정의를 찾을 수 없습니다. 오류
내 .H 파일 :
#import <Foundation/Foundation.h>
@interface TutorsItem : NSObject
@property (nonatomic, strong) NSString *tutorName;
@property (nonatomic) int tutorID;
@property (nonatomic, strong) NSString *tutorPhone;
@property (nonatomic, strong) NSString *tutorEmail;
- (id)initWithName:(NSString *)tutorName tutorID:(int)tutorID tutorPhone:(NSString *)tutorPhone tutorEmail:(NSString *)tutorEmail;
@end
내하는 .m 파일 :
#import "TutorsItem.h"
@implementation TutorsItem
@synthesize tutorName = tutorName;
@synthesize tutorID = tutorID;
@synthesize tutorPhone = tutorPhone;
@synthesize tutorEmail = tutorEmail;
- (id)initWithName:(NSString *)title subtitle:(NSString *)subtitle {
self = [super init];
if (self) {
self.tutorName = tutorName;
self.tutorID = tutorID;
self.tutorPhone = tutorPhone;
self.tutorEmail = tutorEmail;
}
return self;
}
@end
정의 또는 구현? – Wain
오류는 ** 정의 ** @Wain –
입니다. 구현 방법이 귀하의 인터페이스 방법과 전혀 일치하지 않는 이유는 무엇입니까? – Wain