不允许直接修改对象的结构体属性的成员

来源:互联网 发布:高斯如果在清华 知乎 编辑:程序博客网 时间:2024/06/06 09:33
例:self.head.frame.origin.y=self.head.fram.origin.y-10; 是错误的
正确做法 1 CGRect tempFrame=self.head.frame;
2 tempFrame.origin.y-=10;

3 self.head.frame=tempFrame;


字典中的@“icon”  可用宏定义  #define IconKey   @“icon”


数据延迟化:
-(NSArray *)imageData{
if(_imageData==nil){
初始化数据
}
return _imageData;
}

0 0
原创粉丝点击