1。在控制器的viewDidLoad方法中添加代码 CGFloat itemWidth = (kScreenW - kSpacingW * 3) / 2; NSLog(@"itemWidth == %f",itemWidth); CGFloat itemHeight = itemWidth * 0. ...
分类:
其他好文 时间:
2016-04-03 18:47:06
阅读次数:
135
补充: NSLog(@"%s",__func__);//这句话可以打印什么类中的什么方法 一 什么是视图控制器 (1)视图控制器就是用来“控制”或者“管理”界面(视图)的 控制器就是创建控件和给控件传递数据的 “换句话说界面长得丑与美由视图控制器说的算” (2)每个视图控制器(UIViewContr ...
分类:
其他好文 时间:
2016-04-01 17:53:09
阅读次数:
146
NSLog(@"%@",NSStringFromCGRect(pickerView.frame)); 或者 CFShow(NSStringFromCGRect(pickerView.frame)); 打印 CGSize : NSLog(@"%@",NSStringFromCGSize(someCG ...
分类:
其他好文 时间:
2016-04-01 17:46:14
阅读次数:
172
1.创建数据库 NSString * docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]; NSLog(@"%@",docPath); NSStri ...
分类:
数据库 时间:
2016-03-31 23:28:33
阅读次数:
201
一:EXC_BAD_ACCESS异常介绍在调试objective-c程序的过程中,程序crash的现象在所难免,但大部分的错误都能够通过显示的错误原因结合NSLog的方式来解决,比如NSInvalidArgumentException(名字就能看出来是什么错误)等,实在搞不定还有debug这个杀手锏 ...
分类:
移动开发 时间:
2016-03-31 16:54:19
阅读次数:
160
//滑动过程中 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { // NSLog(@"000 %ld",ysetoLoad); UICollectionView *ta = (UICollectionView *)scrollView ...
分类:
其他好文 时间:
2016-03-31 12:25:47
阅读次数:
135
1、快捷键 command+B:编译 command+R:运行 command+/:快速注释 control+i:自动对齐 shift+V 上下键:对齐 2、#include头文件会重复包含,所以用#import,不会重复导入头文件 3、printf与NSLog的区别:printf直接输出内容,NS ...
分类:
其他好文 时间:
2016-03-30 12:26:31
阅读次数:
105
/** * NSDate常见类方法 */ // 获得当前时间 NSDate *date1 = [NSDate date]; // 类方法 // NSDate *date1 = [[NSDate alloc] init]; // 初始化方法 NSLog(@"%@", date1); // 在当前日期基 ...
分类:
其他好文 时间:
2016-03-30 09:51:54
阅读次数:
392
/* * @brief 沙盒下的各种文件 */ - (void)getPaths { /** * @brief 获取沙盒的路径 */ NSString * HomeDirectory = NSHomeDirectory(); NSLog(@"%@",HomeDirectory); /*返回值是数组的 ...
分类:
移动开发 时间:
2016-03-29 14:23:50
阅读次数:
204
NSString *str = @"http://pic92.nipic.com/file/20160323/22486259_160209631000_2.jpg"; NSLog(@"lastPathComponent = %@",[str lastPathComponent]); ...
分类:
移动开发 时间:
2016-03-26 23:40:49
阅读次数:
238