- 博客(19)
- 资源 (10)
- 收藏
- 关注
转载 NSNotificationCenter 的详细说明
. 定义一个方法 -(void) update{ } . 对象注册,并关连消息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update) name:@"update" object:nil] . 在要发出通知消息的地方 [
2012-11-30 10:14:38 671
转载 sqlite处理事务的一个例子
事务在数据库中是一个重要的概念,使用事务可以保证数据的统一和完整性。同时也可以提高效率。拿我们上面创建的persons表来说,假设我要一次插入20个人的名字才算是操作成功,那么,在不使用事务的情况下,如果插入过程中出现异常或者在插入过程中出现一些其他数据库操作的话,就很有可能影响了操作的完整性。所以事务可以很好地解决这样的情况,首先事务是可以把启动事务过程中的所有操作视为事务的过程。等到所有过程执
2012-11-29 22:08:16 9382
转载 SQLite的SQL语法
SQLite库可以解析大部分标准SQL语言。但它也省去了一些特性并且加入了一些自己的新特性。这篇文档就是试图描述那些SQLite支持/不支持的SQL语法的。查看关键字列表。如下语法表格中,纯文本用蓝色粗体显示。非终极符号为斜体红色。作为语法一部分的运算符用黑色Roman字体表示。这篇文档只是对SQLite实现的SQL语法的综述,有所忽略。想要得到更详细的信息,参考源代码和语法文件“pars
2012-11-29 21:58:49 1060
转载 sqlite返回值
返回值我们用来判断是否执行成功。sqlite 中帮我们定义了一系列的宏,用来作为返回值:#define SQLITE_OK 0 /* Successful result *//* beginning-of-error-codes */#define SQLITE_ERROR 1 /* SQL error or missing d
2012-11-29 19:39:43 4077
转载 sqlite 例子
#include #include #include #include int main( int argc, char **argv ){sqlite3 *db;sqlite3_stmt * stmt;const char *zTail;//打开数据库int r = sqlite3_open("mysqlite.db",&db);if(r){
2012-11-29 19:32:59 944
转载 sqlite回传函数相关
执行SQL命令:sqlite3_exec()int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be executed */ sqlite_callback, /* Callback function */ void *data
2012-11-29 19:27:42 2989
转载 IOS数据库操作SQLite3使用详解
iPhone中支持通过sqlite3来访问iPhone本地的数据库。具体使用方法如下1:添加开发包libsqlite3.0.dylib首先是设置项目文件,在项目中添加iPhone版的sqlite3的数据库的开发包,在项目下的Frameworks点击右键,然后选择libsqlite3.0.dylib文件。libsqlite3.0.dylib文件地址: /Developer/Pla
2012-11-28 16:23:16 4479
转载 NSSearchPathForDirectoriesInDomains和NSHomeDirectory差异
iPhone会为每一个应用程序生成一个私有目录,这个目录位于:/Users/sundfsun2009/Library/Application Support/iPhone Simulator/User/Applications下,并随即生成一个数字字母串作为目录名,在每一次应用程序启动时,这个字母数字串都是不同于上一次。所以通常使用Documents目录进行数据持久化的保存,而
2012-11-28 16:18:26 786
转载 字符串的操作
一、字符串的操作1.构建字符串常用的字符串方法:stringWithFormat字符串的附加(创建新的字符串):stringByAppendingString、stringByAppendingFormat2.长度与索引字符.length方法返回长度、characterAtIndex:(int)index返回索引字符3.与C字符串相互转换OC对象–>C:UTF8Stri
2012-11-27 10:12:51 692
原创 objective c基础知识点打通草稿未完
char 可储存单个字符。将字符放入一对单引号中就能得到字符常量。因此,'a',';'和 '0' 都是合法的字符常量。第一个常量表示字母 a,第二个表示分号,第三个表示字符 0,它并不等同于数字0。不要把字符常量和 C风格的字符串混为一谈,字符常量是放在单引号中的单个字符,而字符串则是放在双引号中的任意个数的字符。前面有 @ 字符并且放在双引号中的字符串是 NSString字符串对象。
2012-11-26 23:35:37 1220
转载 UIView中bounds和frame的差别
搞iOS开发的童鞋基本都会用过UIView,那他的bounds和frame两个属性也不会陌生,那这两个有什么实质性的区别呢? 先看到下面的代码你肯定就明白了一些:-(CGRect)frame{ returnCGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width,self.fram
2012-11-23 23:29:21 1154
转载 frame.origin.x 的意思和作用?
frame.origin.x 的意思和作用? scrollView.frame一个view的frame 包含它的矩形形状(size)的长和宽。和它在父视图中的坐标原点(origin)x和y坐标 frame 框架origin就是所謂的起點位置frame在ios里并不是一个具体的对象,他只是一些控件的一个属性。frame的值就是一个CGRect 包括(originX,ori
2012-11-23 17:56:47 14866
转载 iOS5编程--UIApplication深入研究
很多时候,我们不需要关心这个类,我们很少继承这个类,偶尔会调用这个类的api来实现一些功能,但是不可否认,这个类是iOS编程中很重要的一个概念,所以我这里写这个文章来总结以下这个类的信息,如果写的不对的地方,请留言,多谢。UIApplication的核心作用是提供了iOS程序运行期间的控制和协作工作。每一个程序在运行期必须有且仅有一个UIApplication(或则其子类)的一个实例。回想
2012-11-23 17:04:27 775
原创 objective-c 2.0 Mac和iOS开发实践指南 练习(一) 草稿
11.9 练习1.在NSString上编写一个分类方法,用来将字符串种的单词的顺序反向。反向分类方法应该将字符串“dog bites man”变成字符串“man bites dog”,最初的字符串是接受者,并且反向字符串是方法的返回值。编写一个较小的程序来测试---reverseWords。//// NSString+ReverseWords.h// ReverseWo
2012-11-21 14:00:33 1075
转载 NSFileManager – Discovering Directory Contents
Step 1遍历根目录下所有的文件和文件夹,如下:1int main (int argc, const char * argv[]) {2 @autoreleasepool {3 NSFileManager* mgr = [
2012-11-20 14:14:23 1089
转载 [objective-c]—六十六、基础框架(二十四)文件操作-目录操作
下面表格中的措施 适用于NSFileManager这类物件,可以用来进行 目录操作:措施名称描述-(NSString *)currentDirectoryPath获取当前目录的路径-(BOOL)changeCurrentDirectoryPath:path将当前目录的路径更换到path-(BOOL)copyPath:from to
2012-11-20 13:30:54 2234
转载 Event-Driven XML Programming Guide--事件驱动解析XML
转自http://supershll.blog.163.com/blog/static/37070436201251393157364/Event-Driven XML Programming GuideCocoa提供了NSXMLParser类使用事件驱动解析XML文档和使用DTD声明的文档。他把其发现的东西报告给代理,让代理去处理数据。这个文档解释了如何使用NSXML
2012-11-11 20:10:51 1179
转载 Iphone开发之UIView中的动画属性
areAnimationsEnabled返回一个布尔值表示动画是否结束。+ (BOOL)areAnimationsEnabled返回值如果动画结束返回YES,否则NO。 beginAnimations:context:开始一个动画块+ (void)beginAnimations:(NSString *)animationID context:(void *)contex
2012-11-09 22:54:14 537
转载 UIViewController各个方法的加载顺序
加载过程:一般情况下调用 init方法或者调用initWithNibName方法实例化UIViewController, 不管调用哪个方法都为调用initWithNibName(方法定义如下)- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil接着会调用loadView方法来生成
2012-11-09 21:43:34 744
[cnswift.org翻译]最新swift 5.5中文翻译
2021-08-24
[cnswift.org翻译]最新swift 5.3中文翻译
2021-04-06
[cnswift.org翻译]最新swift 5.1中文翻译
2019-07-07
ARKit by Tutorials, 2nd Edition
2019-05-21
[cnswift.org翻译]最新swift 5中文翻译
2019-03-09
Apress.Beginning.Machine.Learning.in.iOS.CoreML.Framework
2019-02-22
[cnswift.org翻译]最新swift 4.2 alpha中文翻译
2018-08-06
iOS Programming: The Big Nerd Ranch Guide (4th Edition) (Big Nerd Ranch Guides)
2014-03-04
iOS 7 App Development Essential
2013-11-27
Effective Objective-C 2.0
2013-11-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人