上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 1 struct tm { 2 int tm_sec; /* seconds */ 3 int tm_min; /* minutes */ 4 int tm_hour; /* hours */ 5 int tm_mday; /* day of the month */ 6 int tm_mon; /* month */ 7 ... 阅读全文
posted @ 2012-02-25 18:49 woainilsr 阅读(7646) 评论(0) 推荐(0)
摘要: ①使用gmtime函数或localtime函数将time_t类型的时间日期转换为struct tm类型:使用time函数返回的是一个long值,该值对用户的意义不大,一般不能根据其值确定具体的年、月、日等数据。gmtime函数可以方便的对time_t类型数据进行转换,将其转换为tm结构的数据方便数据阅读。gmtime函数的原型如下:struct tm *gmtime(time_t *timep);localtime函数的原型如下:struct tm *localtime(time_t *timep);将参数timep所指的time_t类型信息转换成实际所使用的时间日期表示方法,将结果返回到结构 阅读全文
posted @ 2012-02-25 18:43 woainilsr 阅读(754) 评论(0) 推荐(0)
摘要: 1 NSString *src = @"<a href="http://weibo.com" rel="nofollow">新浪微博</a>" 2 NSRange r=[src rangeOfString:@"<a href"]; 3 if (r.location!=NSNotFound) { 4 5 NSRange start=[src rangeOfString:@"<a href=\""]; 6 if (start.location!=NSNo 阅读全文
posted @ 2012-02-25 18:13 woainilsr 阅读(405) 评论(0) 推荐(0)
摘要: 1 uinavigationbar: 2 UIImage *img = [UIImage imageNamed:@"background.png"]; 3 navBar.layer.contents = (id)img.CGImage; 4 5 toolbar: 6 UIImageView *barBackgroudView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320,44)]; 7 barBackgroudView.image = [UIImage imageNamed:@"tbackgro 阅读全文
posted @ 2012-02-22 11:01 woainilsr 阅读(909) 评论(0) 推荐(0)
摘要: 含义 ENCTYPE="multipart/form-data" 说明:通过 http 协议上传文件 rfc1867协议概述,jsp 应用举例,客户端发送内容构造1、概述在最初的 http 协议中,没有上传文件方面的功能。 rfc1867 (http://www.ietf.org/rfc/rfc1867.txt) 为 http 协议添加了这个功能。客户端的浏览器,如 Microsoft IE, Mozila, Opera 等,按照此规范将用户指定的文件发送到服务器。服务器端的网页程序,如 php, asp, jsp 等,可以按照此规范,解析出用户发送来的文件。Microso 阅读全文
posted @ 2012-02-21 20:37 woainilsr 阅读(2389) 评论(0) 推荐(0)
摘要: 加载过程:一般情况下调用 init方法或者调用initWithNibName方法实例化UIViewController, 不管调用哪个方法都为调用initWithNibName(方法定义如下)- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil接着会调用loadView方法来生成UIViewController.view- (void)loadView然后调用 viewDidLoad方法- (void)viewDidLoad如果loadView不能生成UIViewController.v 阅读全文
posted @ 2012-02-21 20:24 woainilsr 阅读(10712) 评论(1) 推荐(2)
摘要: 1 lazytable 例子 2 3 // Set appIcon and clear temporary data/image 4 UIImage *image = [[UIImage alloc] initWithData:self.activeDownload]; 5 6 if (image.size.width != kAppIconHeight && image.size.height != kAppIconHeight) 7 { 8 CGSize itemSize = CGSizeMake(kAppIconHeight, kAp... 阅读全文
posted @ 2012-02-20 20:16 woainilsr 阅读(10070) 评论(0) 推荐(0)
摘要: 计算string串的像素长度:1 CGSize polLabelSize = [polName sizeWithFont:[UIFont boldSystemFontOfSize:16] constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];2 CGSize podLabelSize = [podName sizeWithFont:[UIFont boldSystemFontOfSize:16] constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];3 float polLabelWidth = (po 阅读全文
posted @ 2012-02-17 09:57 woainilsr 阅读(312) 评论(0) 推荐(0)
摘要: 一.C语言的可变参数函数实现首先看一下C语言中的可变参数是怎么实现的:C语言支持va函数,作为C语言的扩展--C++同样支持va函数,但在C++中并不推荐使用,C++引入的多态性同样可以实现参数个数可变的函数。不过,C++的重载功能毕竟只能是有限多个可以预见的参数个数。比较而言,C中的va函数则可以定义无穷多个相当于C++的重载函数,这方面C++是无能为力的。va函数的优势表现在使用的方便性和易用性上,可以使代码更简洁。C编译器为了统一在不同的硬件架构、硬件平台上的实现,和增加代码的可移植性,提供了一系列宏来屏蔽硬件环境不同带来的差异。ANSI C标准下,va的宏定义在stdarg.h中,它们 阅读全文
posted @ 2012-02-08 13:00 woainilsr 阅读(1808) 评论(0) 推荐(0)
摘要: NSLog([[UIDevice currentDevice] name]); // Name of the phone as named by userNSLog([[UIDevice currentDevice] uniqueIdentifier]); // A GUID like stringNSLog([[UIDevice currentDevice] systemName]); // "iPhone OS"NSLog([[UIDevice currentDevice] systemVersion]); // "2.2.1"NSLog([[UID 阅读全文
posted @ 2012-02-08 12:38 woainilsr 阅读(438) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页