oc提供了continue和break来控制循环结构,当然还有return可以结束整个方法;go..to跳转 ...
分类:
其他好文 时间:
2017-03-19 23:52:16
阅读次数:
193
nslog()强大的功能这里就不多说了,笔者从c#转过来,难免会有些陌生。在c#中用format("{0}",xx}来进行占位,下面就来讲讲在oc中的格式字符;d:带符号的十进制形式输出整数(正数不输出符号)o:以八进制无符号形式输出整数(不输出前缀)x:以十六进制无符号形式输出整数(不..
分类:
其他好文 时间:
2017-03-14 14:10:38
阅读次数:
139
OBJC_EXTERN int _objc_rootRetainCount(id); _objc_rootRetainCount(self.QRcodeVc); NSLog(@"_objc_rootRetainCount(qr)%d",_objc_rootRetainCount(self.QRcod ...
分类:
其他好文 时间:
2017-03-07 16:46:26
阅读次数:
151
/* pch步骤:1.提前编译Pch 1.存放公用宏 2.存放公用头文件 3.自定义Log */ #import "UIView+Frame.h" #ifdef DEBUG // 调试 #define XMGLog(...) NSLog(__VA_ARGS__) #else // 发布 #defin ...
分类:
其他好文 时间:
2017-03-02 23:35:53
阅读次数:
153
点击查看代码 1 char *s = "Hello World"; 2 NSString *str = @"Hello Warcraft"; 3 //C -> OC 4 NSString *str1 = [NSString stringWithUTF8String: s]; 5 NSLog(@"st ...
分类:
其他好文 时间:
2017-02-06 12:57:49
阅读次数:
212
-(void)getThreeMonthDate:(NSDate *)mydate { NSLog(@"%@",mydate); //1.创建NSCalendar NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifie ...
分类:
其他好文 时间:
2017-02-03 14:28:01
阅读次数:
128
// 全局队列 异步下载图片 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { dispatch_async(dispatch_get_global_queue(0, 0), ^{ NSLog(@"%@", [NST ...
分类:
其他好文 时间:
2017-01-06 21:50:55
阅读次数:
373
for (id view in [self.view subviews]) { if ([view isEqual:[UITextField class]]) { NSLog(@"你想要?"); } } ...
分类:
移动开发 时间:
2017-01-05 09:58:54
阅读次数:
183
iOS开发中的输出格式大全: %@ 对象 %d, %i 整数%u 无符整形%f 浮点/双字%x, %X 二进制整数%o 八进制整数%zu size_t%p 指针%e 浮点/双字 (科学计算)%g 浮点/双字%s C 字符串%.*s Pascal字符串%c 字符%C unichar%lld 64位长整 ...
分类:
移动开发 时间:
2016-12-24 19:30:26
阅读次数:
235
1. 多态 父类的指针指向子类的对象 @interface Animal: NSObject - (void)eat; @end @implation Dog : Animal - (void)eat{ // 实现父类里面的方法 NSLog (@"啃骨头"); } - (void)shoumen{ ...
分类:
其他好文 时间:
2016-12-16 00:47:20
阅读次数:
334