、通讯录访问在iOS 6中,以前工作正常的访问通讯录的iPhone程序可能会出错,现象是程序启动时不提醒用户是否允许程序访问通讯录,同时在“设置->隐私->通讯录”中看不到你的程序。另外,对通讯录进行操作的代码会报类似于以下消息的错误:[plain] view plaincopyCould not ... Read More
posted @ 2015-04-03 09:14 xiao晖 Views(159) Comments(0) Diggs(0)
字典 字典使用Key-Value的形式存储数据。 字典中的对象存储没有顺序,使用key来表示每个对象。 cocoa框架中的字典:NSDictionary,Set 是无序集合,其存储的对象不允许出现重复。与其他的集合类似。字符串类型:NSString类 可使用length属性获取长度该类提供的函数/方法有: 字符串创建函数 字符串查找函数 字符串截取函数 字符串替换函数 字符串比较函数初始化一个字符串(自定义初始化方法)-(id)initWithString : (NSString *)str;-(id)initWithFormat : (NSString *)format.. (格式转化... Read More
posted @ 2013-04-25 19:33 xiao晖 Views(248) Comments(0) Diggs(0)
<1>自定义初始化方法,然后用这方法给属性赋值,CGPoint 点坐标类型的不能直接赋值 需要,CGPoint mPoint={20,20} CGPoint:mPoint.... <2>单例模式: <.m>文件 <APP 文件> <3>自定义声明方法 .h 实现:.m <4>静态方法实现便利构造器: Read More
posted @ 2013-03-07 18:16 xiao晖 Views(2219) Comments(0) Diggs(0)
#include void changValue1(int x,int y);void changValue1(int x,int y){ int tmp = 0; tmp = x; x = y; y = tmp;}void changValue2(int *x,int *y);void changValue2(int *x,int *y){ int tmp = 0; tmp = *x; *x = *y; *y = tmp;}// 多返回值的函数int calc(int a,int b,int *c);int calc(int a,int b,i... Read More
posted @ 2013-03-06 15:53 xiao晖 Views(154) Comments(0) Diggs(0)
#include #include // 定义数据结构/* 节点 Node */typedef int Element;struct Node{ Element data; struct Node *next;};// 创建单链表struct Node * createList(void);struct Node * createList(void){ struct Node *head = NULL; struct Node *temp = NULL; struct Node *tail = NULL; int data; scanf("%d",... Read More
posted @ 2013-03-06 15:38 xiao晖 Views(434) Comments(0) Diggs(0)
#include #include //节点 Nodetypedef int Element;struct Node{ Element data; struct Node *next;}; //创建列表struct Node * creatList(void);struct Node * creatList(void){ struct Node *head=NULL; struct Node *tail=NULL; struct Node *temp=NULL; int data; scanf(... Read More
posted @ 2013-03-06 15:36 xiao晖 Views(3119) Comments(0) Diggs(0)
学校没学好的C语言,在被带领来一遍简单的复习,理清大概的编程思想,就开始了由面向对象向面向过程的转变。Object-C,是c语言的一种扩充,首先要理解的是类与对象的概念。类相当于某一类由同种特征属性的元素的集合,对象是其中的实例变量。一个类,分为声明部分和实现部分。程序的模块实现,是在实现里面完成。 举个例子,关于学生类,包含属性有,姓名,年龄,打招呼的方法,兴趣。声明部分: .h 文件 #import<Foundation/Foundation> @interface Student : NSObject { NSString *name; ... Read More
posted @ 2013-03-05 14:54 xiao晖 Views(145) Comments(0) Diggs(0)