@interface Person : NSObject
@property (nonatomic, strong, nullable) NSString *firstName;
@property (nonatomic, strong, nullable) NSString *lastName;
@end
@implementation Person
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
Person *person = [[Person alloc] init];
person.firstName = @"Tom";
person.lastName = @"Google";
NSLog(@"person full name: %@ %@", person.firstName, person.lastName);
}
@end
person实例
最新推荐文章于 2020-07-31 00:47:22 发布