摘要: 从数据保存的方式上讲可以分为三大部分:属性列表、对象归档、嵌入式数据库(SQLite3)、CoreData等这里主要解释 属性列表,对象归档1.属性列表首先要知道获取应用程序中能保存数据的路径, http://www.cnblogs.com/jinjiantong/archive/2013/02/23/2923717.html 这里提过1)一种简单的方法是,获取目录路径后直接写下去-(IBAction) save { NSArray * myPaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDoma. 阅读全文
posted @ 2013-03-21 11:51 金建彤 阅读(1064) 评论(0) 推荐(0) 编辑
摘要: 来至:http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/bxUsing.html#//apple_ref/doc/uid/TP40007502-CH5-SW11.block是什么int(^oneFrom)(int)=^(intanInt){returnanInt-1;};printf("1from10is%d",oneFrom(10));分析:1.int(^oneFrom)(int) => 1,第一个int为返回类型 2,^为block标志, b 阅读全文
posted @ 2013-03-21 02:21 金建彤 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 来自:http://blog.csdn.net/caryaliu/article/details/7907196int_lastPosition=0; -(void)scrollViewDidScroll:(UIScrollView*)scrollView{intcurrentPostion=scrollView.contentOffset.y;if(currentPostion-_lastPosition>25){_lastPosition=currentPostion;NSLog(@"ScrollUpnow");}elseif(_lastPosition-curr 阅读全文
posted @ 2013-03-21 01:19 金建彤 阅读(415) 评论(0) 推荐(0) 编辑
摘要: http://bynomial.com/blog/?p=52加边框:label.layer.borderColor = [UIColor blueColor].CGColor;label.layer.borderWidth = 1;圆角:label.layer.cornerRadius = 20;label.layer.borderColor = [UIColor grayColor].CGColor;label.layer.borderWidth = 3;加阴影:label.layer.shadowColor = [UIColor blackColor].CGColor;label.laye 阅读全文
posted @ 2013-03-21 01:12 金建彤 阅读(300) 评论(0) 推荐(0) 编辑
摘要: char * strcpy(char * str1 ,const char *str2){ if(str1==NULL || str2==NULL) return NULL; //用NULL来判断字符串是否有效 if(str1==str2) return str1; char * temp=str1; while((*str1++=*str2++)!='\0'); //字符串结束符为\0 return temp;} 阅读全文
posted @ 2013-03-21 01:06 金建彤 阅读(228) 评论(0) 推荐(0) 编辑