我是Objective C的新手。我正在尝试以下方法:
#import "Person.h"
@implementation Person
-(void) setDetails:(NSString*)FirstName :(NSString *)Surname :(int)age{
_firstName = FirstName;
_surname = Surname;
_age = age;
}
-(void) printDetails{
NSLog(@"The details of the person are FirstName %@, Surname %@, Age %d", _firstName,_surname,_age);
}
@end
主:
#import <Foundation/Foundation.h>
#import "Person.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
Person *noor = [Person new];
[noor setDetails:@"Noor" :@"Bake" :24];
[noor printDetails];
}
return 0;
}
但是我得到了这个结果:(lldb)
。我期待它打印出这个人的细节
但它正在打印(lldb)。
有什么建议吗?