当前位置: 移动技术网 > 移动技术>移动开发>IOS > iOS从零基础到精通就业-OC语言入门 属性3

iOS从零基础到精通就业-OC语言入门 属性3

2019年01月05日  | 移动技术网移动技术  | 我要评论
//
//  phone.h
//  属性
//
//  created by 蓝鸥 on 16/7/29.
//  copyright © 2016年 luanbin. all rights reserved.
//

#import 

@interface phone : nsobject

//手机的属性
//修饰对象用retain 基本数据类型用assign
//nonatomic非原子性
//atomic 原子性 保证线程安全
@property(nonatomic,retain) nsstring *brand;
@property(nonatomic,retain) nsstring *color;
@property(nonatomic,retain) nsstring *address;
@property(nonatomic,assign) float price;

@property(nonatomic,retain) nsstring *time;




@end

phone.m
//
//  phone.m
//  属性
//
//  created by 蓝鸥 on 16/7/29.
//  copyright © 2016年 luanbin. all rights reserved.
//

#import "phone.h"

@implementation phone

//kvc 赋值出错的时候会调用这个方法
-(void)setvalue:(id)value forundefinedkey:(nsstring *)key
{
    nslog(@"这个方法走了.....%@",key);
}


@end

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网