
iOS开发—随手记
eatttttttt
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
获取静态TableView选中的cell来执行相应操作
根据点击的是哪个section的哪个row 来做出响应。- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.section==0) { switch (indexPath.ro原创 2015-05-29 18:11:57 · 761 阅读 · 0 评论 -
在OS X 10.11上安装cocoapods时出现错误
错误如下:ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/fuzzy_match解决方法: 输入sudo gem install -n /usr/local/bin cocoapods即可解决问题另外,淘宝镜像地址已经由原来的原创 2015-12-11 16:56:42 · 1111 阅读 · 0 评论 -
iOS 用代码添加模态视图
ModalViewController * modalView = [[ModalViewController alloc]init]; modalView.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:modalView animated:YES co原创 2015-07-21 20:29:20 · 705 阅读 · 0 评论 -
使tableview每个section显示不同行数的方法
有时候我们需要让tableview的不同section显示不同的行数,比如在设置页面,或者个人信息页面等都会用到。方法如下:- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 3;}- (NSInteger)tableView:(UITableView *)tabl原创 2015-07-16 22:31:32 · 1653 阅读 · 0 评论 -
关于错误perhaps the designated entry point is not set的解决方法
错误:Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?出现错误的的原因是没有给你的StoryBoard设置默认显示的controller解决方法:原创 2015-05-29 21:08:47 · 1151 阅读 · 0 评论 -
tintColor和barTintColor的使用
barTintColor可以使状态栏的颜色和NavigationBar的颜色相同例如:self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:100.0/255.0原创 2015-05-29 18:38:04 · 1320 阅读 · 0 评论 -
关于Xcode6模拟器 键盘不显示和没有中文输入法的解决方案
键盘不显示的解决方法:只需要在模拟器的菜单中找到hardware -> keyboard -> 取消勾选connect hardware keyboard (快捷键shift+command+k) 即可解决。原因是因为在8.0的模拟器中默认是Xcode使用电脑键盘作为外接键盘,不再弹出虚拟键盘。如果设置了文本框的inputAccessoryView,那么只会原创 2015-05-29 17:49:13 · 1014 阅读 · 0 评论 -
iOS tableview获取当前选中的cell
NSIndexPath* indexPath = [self.tableView indexPathForSelectedRow];原创 2015-05-28 19:49:10 · 1048 阅读 · 0 评论 -
如何解决警告 warning: directory not found for option
选择项目名称----->Targets----->Build Settings----->Search Paths----->Library Search Paths 删除对应路径原创 2015-05-28 19:09:51 · 1016 阅读 · 0 评论 -
关于viewController中的tableview的cell在pop回来后仍有选中效果的解决方法
将tableview添加进viewController以后,会产生一个问题,当点击cell push到另个viewController以后再返回时,cell的状态还是为选中状态。因为UITableViewController有一个clearsSelectionOnViewWillAppear的property,而UIViewController没有,因此要手动取消选中的状态。原创 2015-12-11 19:56:57 · 1051 阅读 · 0 评论