创建pch 文件 STEP1: #ifdef DEBUG # define NSLog(...) NSLog(__VA_ARGS__) #else # define NSLog(...) #endif #define ALog(...) NSLog(__VA_ARGS__) STEP2: a. TA ...
分类:
其他好文 时间:
2016-08-21 22:51:54
阅读次数:
178
- (void)getSize2 { // 图片缓存 NSUInteger size = [SDImageCache sharedImageCache].getSize; // NSLog(@"%zd %@", size, NSTemporaryDirectory()); NSFileManager ...
分类:
移动开发 时间:
2016-08-17 12:10:14
阅读次数:
198
一、description方法 Description方法包括类方法和对象方法。(NSObject类所包含) (一)基本知识 -description(对象方法) 使用NSLog和@%输出某个对象时,会调用对象的description方法,并拿到返回值进行输出。 +description(类方法) ...
分类:
编程语言 时间:
2016-08-14 16:17:07
阅读次数:
150
一个xcode工程默认是在一个主线程的,有需要可以创建分线程 判断是否是主线程: NSThread *thread1=[NSThread currentThread]; if ([red isMainThread]) { //判断当前线程是否是主线程 NSLog(@"currentThread:%@ ...
分类:
移动开发 时间:
2016-08-14 16:04:23
阅读次数:
154
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; if(UIRemoteNotificationTypeNone != type){ NSLog(@" ...
分类:
其他好文 时间:
2016-08-12 11:48:32
阅读次数:
360
po [self.view recursiveDescription],打印分析视图的层级 1, 在PCH文件中添加以下代码,来判断当前工程的版本号 #if DEBUG 1, 在PCH文件中添加以下代码,来判断当前工程的版本号 #if DEBUG #define NSLog(...) NSLog(_ ...
分类:
其他好文 时间:
2016-08-10 16:14:17
阅读次数:
118
#if TARGET_IPHONE_SIMULATOR NSLog(@"run on simulator"); #else NSLog(@"run on device"); #endif 注意不要用#ifdef TARGET_IPHONE_SIMULATOR, 因为在device上, TARGET_ ...
分类:
其他好文 时间:
2016-08-05 11:40:58
阅读次数:
358
一、description方法 Description方法包括类方法和对象方法。(NSObject类所包含) (一)基本知识 - description(对象方法) 使用NSLog和%@输出某个对象时,会调用对象的description方法,并拿到返回值进行输出。 + description(类方法 ...
分类:
编程语言 时间:
2016-08-03 23:31:57
阅读次数:
144
//给某个view增加颜色透明度渐变图层 - (void) insertTransparentGradient { NSLog(@"%@",NSStringFromCGRect(self.imgView.bounds)); UIColor *colorOne = [UIColor colorWith ...
分类:
其他好文 时间:
2016-08-02 19:01:01
阅读次数:
174