2.12-3.20上周的习惯坚持下来了✌️精诚所至金石为开,加油兄弟
妹妹婚礼,祝福妹妹,幸福的新娘子,下周yy过来,但是任务比较重,跟同事搞好关系,跟峰哥商量好,要是实在不行,找人帮忙搞一下,周末没办法加班了
block反向传值,代替代理跳转弄明白了,在pop的时候调用dealloc说明控制器没有内存泄露
QQ好友列表,点击headerView收起分组,使用block替换代理,
遇到崩溃的问题,exc_bad_access
野指针
正确的使用步骤:
1.在headerView的类中声明一个block属性,
// HeaderView.h
typedef void(^headerViewClicked)();
@interface HeaderView : UITableViewHeaderFooterView
@property (nonatomic, copy) headerViewClicked headerClicked;
2.在点击headerView调用的方法中执行block headerClicked()
// HeaderView.m
UITapGestureRecognizer *tapGest = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headerViewDidClicked:)];//headerViewDidClicked:用Block属性
-(void)headerViewDidClicked:(headerViewClicked)headerViewClicked {
//--------------用block方法
// _headerClicked = headerViewClicked; // 没有赋值,不能使用,会崩溃
//----------用block属性 之前block已经赋值好
self.sectionNameModel.showCell = !self.sectionNameModel.showCell;
if (_headerClicked) {
_headerClicked();
}
}
3.在控制器中给headerView的Block属性赋值
// SectionTableViewController.m
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
HeaderView *headerView = [[HeaderView alloc]init];
headerView.sectionNameModel = self.sectionNameArray[section];
headerView.tag = section;
__weak __typeof(self)weakSelf = self;
//------------------------------------用block方法
// NSIndexSet *set = [NSIndexSet indexSetWithIndex:headerView.tag];
// [headerView headerViewDidClicked:^{
// NSLog(@"*******************");
// [weakSelf.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationFade];
// }];
//------------------------------------用block属性
NSIndexSet *set = [NSIndexSet indexSetWithIndex:headerView.tag];
headerView.headerClicked = ^(){
NSLog(@"*******************");
[weakSelf.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationFade];
};
return headerView;
}
错误的使用步骤:
1.在headerView的类中声明一个block属性,
2.在headerView的类中声明一个带block的方法,headerViewDidClicked:
3.在点击headerView调用的方法(headerViewDidClicked:)中执行block headerClicked(),修改模型显示隐藏bool
4.在控制器中调用headerView的带Block的方法
正确的使用步骤:
1.在headerView的类中声明一个block属性,
2.在headerView的类中声明一个带block的方法,headerViewDidClicked:
- (void) headerViewDidClicked:(headerViewClicked)headerViewClicked;
3.在点击headerView调用的方法(另外一个方法)(showOrHide)中执行block headerClicked(),修改模型显示隐藏bool
// HeaderView.m
UITapGestureRecognizer *tapGest = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(showOrHide)];
-(void)headerViewDidClicked:(headerViewClicked)headerViewClicked {
//--------------用block方法
_headerClicked = headerViewClicked; // 没有赋值,不能使用,会崩溃
}
- (void)showOrHide{ // 用block方法
self.sectionNameModel.showCell = !self.sectionNameModel.showCell;
if (_headerClicked) {
_headerClicked();
}
}
4.在控制器中调用headerView带Block的方法
// SectionTableViewController.m
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
HeaderView *headerView = [[HeaderView alloc]init];
headerView.sectionNameModel = self.sectionNameArray[section];
headerView.tag = section;
__weak __typeof(self)weakSelf = self;
//------------------------------------用block方法
NSIndexSet *set = [NSIndexSet indexSetWithIndex:headerView.tag];
[headerView headerViewDidClicked:^{
NSLog(@"*******************");
[weakSelf.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationFade];
}];
return headerView;
}
------------------------------------------
git公钥
svedeMacBook-Air:.ssh sve$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ3hjA/+E+53hfOV9ufoT5L+bpzQtXjocksgXVq1j4tT9PC1cwe4jg42X+NMFHw/lM9wz6zWknanC+iG4iiT4B5wwybRZ/pBHmiPrkaaGTuo8AqccwekGgMuic9zyhM2u1LbiG8Px5hS1X8ToyOM7tMWpvTW6Tib3nZiSc0R7I6GRE50PJrGC33DBQJT/0gE5WEE82mNzFgXCKZv81fnCriYyySvwLpKmc+GynCWMSoRILjA5+2Yxe07UYVPSzRebfKMr/eEJfwQHY7xWobI4Oa4q9UjbQFUE5f+up18pqxTuz9c28tUSFJqofnsUUZXFmFkdEegaKLw+zkQhqgiCl songximing@haodf.com
svedeMacBook-Air:.ssh sve$
---------------------------------------------------------------------------
[[HDFSearchBarView alloc] initWithFrame:(CGRect){CGPointZero, SCREEN_WIDTH, 44} delegate:self]
--------
Bundle
-----------------------------------------------------------------------------------------------------
粗心的错误,textField一直出不来,后来发现黄色的写成了backGroundView ,给backGroundView 加约束
UITextField *telInputTextField = [[UITextField alloc]init];
[backGroundView addSubview:telInputTextField];
[telInputTextField mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(backGroundView.mas_top);
make.bottom.equalTo(backGroundView.mas_bottom);
make.left.equalTo(phoneLabel.mas_right).offset(0);
make.right.equalTo(backGroundView.mas_right).offset(-10);
}];
-----------------------------------------------------------------------------------------------------
三个大view一直出不来
----------------------------------------------------------------------------------------------------
block反向传值后,直接跳转了控制器,没停留,旧代码没删除
在第二个控制器定义block属性,在点击方法中执行这个Block
在第一个控制器中给block赋值
----------------------------------------------------------------------------------------------------
textField收起
leeGof
------------------------------------------------------------------------------------------------
上面的写法不能设置按钮的文字,必须用下面的Set方法才能设置按钮文字
// hdfServeAgreementButton.titleLabel.text = @"好大夫服务协议";
[hdfServeAgreementButton setTitle:@"好大夫服务协议" forState:UIControlStateNormal];
------------------------------------------------------------------------------------------------
loadView
storyBoard
.xib
viewController.xib
空view
所以得干掉xib才能不显示xib
-----
// if (self.isFromAddNewPatient) {
myPatientId = self.patientInfoView.patientModel.patientId;
// }else{
// myPatientId = self.patientModel.patientId;
// }
干啥的判断?是新添加的患者还是从患者列表选选择的患者
-----
记录一下:ios 6中以前一直没注意,textField原来文字默认是顶对齐,额,,用ios 6现在测才发现,,,不居中不好看啊,
更改如下:
[textField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
在pop的时候没有走dealloc
ENFullScreenPicker.h滚轮picker
doctorAppDelegate *doctorDelegate = (doctorAppDelegate *)[UIApplication sharedApplication].delegate; 获取APPdelegate
双布尔值搞定,点击
转载于:https://www.cnblogs.com/tufei7/p/5300442.html
2.12-3.20上周的习惯坚持下来了✌️精诚所至金石为开,加油兄弟相关推荐
- 糟糕程序员的20个坏习惯
糟糕程序员的20个坏习惯 转自:https://mp.weixin.qq.com/s/6hUU6SZsxGPWAIIByq93Rw 阅读本文大约需要 5 分钟. 你好,我是 Kaito. 今天我想和你 ...
- 阻碍你登上成功宝座的20大不良习惯
近年来企业自助书籍已成为出版业销路稳定的主要商品.在企业界,那些声称揭示企业成功秘笈的书籍自身也获得了巨大的成功,它们总是稳居销量排行榜的榜首位置,同时还成就了盖里·拉恩克(Gary Ranker). ...
- AI智商评测标准专家研讨会邀请,2018年12月20日北京
21世纪以来,人工智能领域陆续爆发很多重要事件.其中最吸引人们眼球的,当属2016年战胜了人类围棋冠军并开始能够从0自我学习的AlphaGo. 10月26日,软银CEO孙正义在沙特阿拉伯举行的未来投资 ...
- 机器之心 Synced 08月12日 20:59
机器之心 Synced 08月12日 20:59 机器学习 人工智能 谷歌大脑 分类 :互联网 阅读:333 抢沙发 分享到: 0 分享到微信朋友圈 打开微信.点击 " 发现 &quo ...
- 成功领导者的20个好习惯
成功领导者的20个好习惯 在研究大量成功企业领导者的案例后,我们发现,这些最优秀的企业领导人知道自己需要什么,并能尽全部的努力去达到自己的目标,他们懂得做人.善于决策.充 满热忱.持续创新.架构关系. ...
- 山东省2020年12月计算机考试,12月20日开始报名!山东2020年3月全国计算机等级考试注意事项来咯...
近日,山东省教育招生考试院发布了<山东省2020年3月全国计算机等级考试报名事项公告>(以下简称<公告>),考生个人网上注册报名时间为2019年12月20日9:00至28日24 ...
- 全国计算机等级报名12,全国计算机等级考试12月20日开始报名!注意事项请查收!...
原标题:全国计算机等级考试12月20日开始报名!注意事项请查收! 山东省教育招生考试院发布了 <山东省2020年3月全国计算机等级考试报名事项公告> (点击文章标题查看公告),考试将于20 ...
- 2020计算机二级报名时间表下半年山东,2020年3月山东省计算机二级报名时间|网上报名入口【12月20日9:00开通】...
  [导读]:2020年3月山东省计算机二级报名时间:2019年12月20日9:00至28日24:00 (一)报名时间 考生个人网上注册报名时间:2019年12月20日 ...
- Navicat 12.1.20的安装
Navicat 12.1.20的安装 1.前些天浏览github的时候,发现自己曾经star过navicat-keygen这个项目 https://github.com/DoubleLabyrinth ...
最新文章
- element走马灯自动_Element Carousel 走马灯的具体实现
- github设置中文_静态博客托管图片至 GitHub
- jquery 当页面图片加载之后_图片的懒加载和预加载
- 首屏动画及验证网络状态跳转
- Exchange 2010 OWA 无法使用关键字搜索
- java.lang.IllegalArgumentException: No enum constant org.apache.ws.commons.schema.XmlSchemaForm.
- 海康SDK/Ehome协议/RTSP协议/GB28181安防视频云服务EasyCVR前端音频采集流程介绍
- revit二次开发概念_半天入门Revit二次开发
- hive错误FAILED: SemanticException [Error 10041]: No partition predicate found for
- 转载:浅谈Session与Cookie的区别与联系
- 《k3s 源码解析4 ---- k3s重要数据结构》
- 游戏行业比影视行业哪个更有前景?来看数据说话!
- 静态HTML网页设计作品 代码质量好-上海介绍(5页) HTML+CSS+JavaScript(含源码)
- hbase生存期TTL的设置
- coreseek 安装及使用方法详解
- 分析国内某大型快递公司(Y速递)
- BugkuCTF-WEB-网站被黑
- ping: www.xxx.com: 未知的名称或服务
- 安卓 UI 项目:仿照西瓜视频首页 UI界面
- 如何为Compose Image提供网络图片加载支持
热门文章
- 创业如创作,保持热爱
- UltraEdit的注册码,版本:15.10.0.1026
- 【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于阿里云、小程序、Arduino的温湿度监控系统
- U盘安装MacBook系统
- 计算机视觉中的高效阅读论文的方法总结
- 34.驱动--块设备驱动
- matlab怎么列向量归一化语句,matlab向量归一化
- 硬件测试和软件测试的区别以及概念
- 第2部分 字符串算法(提高篇)--第2章 KMP算法1469:似乎在梦中见过的样子
- 截取图片DEMO. JAVA Windows FFmpeg