经常在源码中看到类似于如此定义debug模式#if DEBUG#define NSLog(FORMAT, ...) fprintf(stderr,"\nfunction:%s line:%d\n%s\n", __FUNCTION__, __LINE__, [[NSString stringWit.....
分类:
其他好文 时间:
2015-12-08 20:24:47
阅读次数:
175
#import void setBeingRemoved(id __self, SEL _cmd){ NSLog(@"------------UNSELECT BY INVOKE.");}// Then these two lines: Class __class = NS...
分类:
其他好文 时间:
2015-12-08 17:57:38
阅读次数:
276
一、description方法Description方法包括类方法和对象方法。(NSObject类所包含)(一)基本知识-description(对象方法)使用NSLog和@%输出某个对象时,会调用对象的description方法,并拿到返回值进行输出。+description(类方法)使用NSLo...
分类:
其他好文 时间:
2015-12-08 12:56:35
阅读次数:
117
一、类的本质1、类也是个对象其实类也是一个对象,是Class类型的对象,简称“类对象”Class类型的定义 typedef struct objc_class *Class;类名就代表着类对象,每个类只有一个类对象2、+load和+initialize+load 在程序启动的时候会加载所有的类和.....
分类:
其他好文 时间:
2015-12-08 00:07:13
阅读次数:
185
最近开发程序,需要做个给测试人员的demo,客户端可以实时 显示程序的打印日志的功能,查找了很多的资料找到个方法,利用NSPipe即可以实现,苹果官方解释: objects provide an object-oriented interface for accessing pipes. AnN.....
分类:
移动开发 时间:
2015-12-07 20:49:52
阅读次数:
237
int r = arc4random(); NSLog(@"%d",r); NSLog(@"%d",r%100);//模上100 0-99NSArray *array = @[@"one",@"two",@"three"]; for (NSString *s in array)...
分类:
其他好文 时间:
2015-12-07 14:09:33
阅读次数:
128
一、注释1. 注释是什么?注释就是在代码中一段用来说明的,不执行的字符串。2. 注释的定义?在 OC 中,我们使用双斜杠“//”来表示单行注释,在一句代码的最开始处加上双斜杠(//)即可。//NSLog(@"这行代码是单行注释");我们还使用“/*”和“*/”表示多行注释。/*NSLog(@"窗前明...
分类:
其他好文 时间:
2015-12-07 10:12:54
阅读次数:
128
NSDate NSDate 时间类,继承自NSObject,其对象表示一个时间点 NSDate *date = [NSDate date]; NSLog(@"date = %@", date); 2015-12-04 19:08:00.624 OCNSDate[2955:309612...
分类:
其他好文 时间:
2015-12-05 14:11:57
阅读次数:
168
NSpredicate 常用方法 // 谓词的条件查询 > 、 20"]; NSArray *arr1 = [stuArray filteredArrayUsingPredicate:predicate1]; NSLog(@"arr1 = %@",arr1); //使...
分类:
移动开发 时间:
2015-12-03 23:03:50
阅读次数:
189
- (IBAction)button_Click:(id)sender { if([selfisValidateMobile:@"输入你要验证的手机号码"] ==YES) { NSLog(@"手机号正确"); }else{ NSLog(@"手机号错误"); } if([selfisVa...
分类:
移动开发 时间:
2015-12-03 19:16:11
阅读次数:
183