摘要: 统计字数 1、首先注册监听 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textViewEditChanged:) name:@"UITextViewTextDidChangeNotificati 阅读全文
posted @ 2016-03-08 17:30 Mr_tao 阅读(338) 评论(0) 推荐(0)
摘要: 有时候调用苹果手机的系统键盘满足不了现实中的各种需求,因此就需要我们自定义键盘来代替系统原有的键盘 话不多说,直接上代码: 首先代码创建一个输入框或直接在storyboard中拖一个UITextFild来弹出键盘: _textField = [[UITextField alloc] init]; _ 阅读全文
posted @ 2016-03-02 10:02 Mr_tao 阅读(595) 评论(0) 推荐(0)
摘要: 1、首先设定一个属性记录当前选中的按钮 /** * 记录当前选中的按钮 */ @property (nonatomic, weak) UIButton *selectedButton; 2、当点击按钮的时候改变按钮的选中状态 - (IBAction)goButton:(UIButton *)send 阅读全文
posted @ 2016-02-29 11:14 Mr_tao 阅读(3538) 评论(0) 推荐(0)
摘要: 1、把需要保存的信息已plist文件形式保存在本地,即写入沙盒: /** * 写入本地(plist文件) */ - (void)saveArray { // 1.获得沙盒根路径 NSString *home = NSHomeDirectory(); // 2.document路径 NSString 阅读全文
posted @ 2016-02-29 09:39 Mr_tao 阅读(747) 评论(0) 推荐(0)
摘要: 苹果原生的tableView的cell分割线默认是没有从最左端开始,有时候这样不免影响美观,有时也会有这样的需求,设置tableView的分割线从最左端开始: 不多说了,直接上代码吧: //分割线从顶端开始 --------适配iOS7 8---------- - (void)viewDidLayo 阅读全文
posted @ 2016-02-27 16:37 Mr_tao 阅读(731) 评论(0) 推荐(1)
摘要: 1、首先实现按钮点击跳转的实现方法 - (IBAction)go:(id)sender { UIStoryboard *secondStroyBoard=[UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *t 阅读全文
posted @ 2016-02-27 16:29 Mr_tao 阅读(357) 评论(0) 推荐(0)
摘要: Xcode真机测试时出现 The application could not be verified. 解决办法: 删除之前在设备上安装的app就好了,估计问题应该是上一次的证书跟现在的证书不一致导致。可能是应为选择证书时reset了导致和以前的 证书不一致了 阅读全文
posted @ 2016-02-18 14:12 Mr_tao 阅读(259) 评论(0) 推荐(0)
摘要: - (CGFloat)getCellHeight:(UITableViewCell*)cell { [cell layoutIfNeeded]; [cell updateConstraintsIfNeeded]; CGFloat height = [cell.contentView systemLa 阅读全文
posted @ 2016-01-25 11:49 Mr_tao 阅读(576) 评论(0) 推荐(0)
摘要: @property (nonatomic, assign) NSInteger timeout; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(100, 100, 阅读全文
posted @ 2016-01-25 11:10 Mr_tao 阅读(145) 评论(0) 推荐(0)
摘要: 1、 (1) 第一步,制定协议 //因为是ConfigViewController其他界面发送消息 // 1. 告诉其他界面我要给你发送什么消息 // 2. 确保其他实现了消息对应的方法 // 声明协议和协议方法 @protocol ConfigViewControllerDelegate <NSO 阅读全文
posted @ 2016-01-22 14:26 Mr_tao 阅读(379) 评论(0) 推荐(0)