https://segmentfault.com/a/1190000005668218 也就说: 1. 如果是 OC 的对象,重写 description 的 get 方法就可以了。 2. 如果不是 OC 对象,遵循协议 CustomDebugStringConvertible 就可以了。 输出: ...
分类:
编程语言 时间:
2016-06-09 12:19:29
阅读次数:
256
NSLog(@"%@",NSStringFromCGRect(switch.frame)); 或者 CFShow(NSStringFromCGRect(switch.frame)); 打印 CGSize : NSLog(@"%@",NSStringFromCGSize(someCG Size )); ...
分类:
其他好文 时间:
2016-06-08 00:00:49
阅读次数:
244
在pch文件中: #ifdef DEBUG #define ZSLog(...) NSLog(__VA_ARGS__) #else #define ZSLog(...) #endif ...
分类:
移动开发 时间:
2016-06-07 12:58:48
阅读次数:
261
//调用 NSInteger i = [self howManyDaysInThisMonth:2]; NSLog(@"%ld",(long)i); // 获取今年指定月的天数 - (NSInteger)howManyDaysInThisMonth :(NSInteger)imonth { int ...
分类:
移动开发 时间:
2016-06-01 14:19:57
阅读次数:
249
去掉日志 #ifndef __OPTIMIZE__ #define NSLog(...) NSLog(__VA_ARGS__) #else #define NSLog(...){} #endif 打开Xcode -->>product -->scheme -->>edit scheme -->inf ...
分类:
移动开发 时间:
2016-05-31 19:06:18
阅读次数:
203
类型例子NSLog chars char 'a', '\n' %c short int — %hi, %hx, %ho unsigned short int %hu, %hx, %ho int 12, -97, 0xFFE0, 0177 %i, %x, %o unsigned int 12u, 10 ...
分类:
其他好文 时间:
2016-05-31 16:01:28
阅读次数:
120
NSLog(@"客服电话"); UIWebView*callWebview =[[UIWebView alloc] init]; NSURL *telURL =[NSURL URLWithString:@"tel:400-041-5656"];// 貌似tel:// 或者 tel: 都行 [call ...
分类:
其他好文 时间:
2016-05-31 12:14:43
阅读次数:
160
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { // 输出点击的view的类名 NSLog(@"%@", NSStringFromClas ...
分类:
其他好文 时间:
2016-05-31 12:09:46
阅读次数:
134
//存 NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *path=[paths objectAtIndex:0]; NSLog(@"path ...
分类:
移动开发 时间:
2016-05-27 14:29:48
阅读次数:
189
代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //会输出1或者0.1为YES,0为NO NSLog(@" %i--",[self validateMo ...
分类:
移动开发 时间:
2016-05-26 10:09:55
阅读次数:
162