1 NSDate *date = [NSDate date];//获取当前时间 // NSLog(@"%@",date); NSTimeZone *zone = [NSTimeZone systemTimeZone]; NSInteger timeOff = [zone secondsFromGM....
分类:
其他好文 时间:
2015-11-03 17:30:32
阅读次数:
220
NSDate *date =[NSDate date];//当前时间 NSLog(@"%@",date); NSDate *date1 = [NSDate dateWithTimeIntervalSinceNow:3600.0*10];//从当前时间开始,若干秒后的时间,参数...
分类:
其他好文 时间:
2015-11-03 12:14:45
阅读次数:
211
#import //import://1,同#include一样, 拷贝文件内容//2,可以自动防止文件的内容被重复拷贝/*#import NSObjCRuntime.h中有NSLog函数的声明 3,Foundation框架头文件的路径 Xcoude.app 显示包内容 Xcode....
分类:
其他好文 时间:
2015-11-03 10:44:23
阅读次数:
263
现在,要添加一个保存修改的方法。其实很简单,就是调用持久化存储协调器的save方法。- (void)saveContext { if (debug == 1) { NSLog(@"Running %@ '%@'",self.class, NSStringFromSelecto...
分类:
其他好文 时间:
2015-11-02 17:09:38
阅读次数:
238
1.C语言面向过程,OC面向对象2.第一个OC程序#import int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSLog(@"Hello, W...
分类:
其他好文 时间:
2015-11-02 10:19:16
阅读次数:
274
/************** NSDate *************/ //创建NSDate实例,返回GMT时间 NSDate *date1=[NSDate date]; NSLog(@"%@",date1); //返回date1保存的时间与date2的时间间隔 //NSTimeInterval...
分类:
其他好文 时间:
2015-11-01 22:44:24
阅读次数:
188
#import?"RootViewController.h"
#define?kScreenSize?[UIScreen?mainScreen].bounds.size
#define?kPrintDebug?NSLog(@"%s",__func__)
@interface?RootViewController?()<UIScrollViewDelegate>
{
?...
分类:
其他好文 时间:
2015-10-31 13:09:10
阅读次数:
175
1.数组的创建OC中数组存储对象的地址对象方法初始化1 NSArray * arr1 = [[NSArray alloc] initWithObjects:@"one",@"two",@"three", nil];2 3 NSLog(@"%@",arr1);类方法初始化1 NSArr...
分类:
编程语言 时间:
2015-10-31 00:24:20
阅读次数:
269
RootViewController代码如下: #import?"RootViewController.h"
#import?"MyControl.h"
#import?"SecondViewController.h"
#define?kDebugPrint?NSLog(@"%s",__func__)
@interface?RootViewController?()
...
分类:
移动开发 时间:
2015-10-30 12:43:25
阅读次数:
249
自定义NSLog 在项目里面为了调试的方便, 你京城使用NSLog 如果项目上线的时候,没有删除这些NSLog,app运行缓慢, 而且会产生垃圾文件。自定义日志的好处:在开发的时候对输出内容,在上线的时候不会输出前提:我们需要在测试状态和上线状态下进行测试
分类:
其他好文 时间:
2015-10-29 23:12:15
阅读次数:
262