重要概念:某些路径下“只能读,不能写”的原因 iPhone、ipad真机上 Resouces文件夹:是只读的,无法写入。 document 和temp文件夹:可读,可写。@inter PlistMange :NSObject-(void)resourcePathFileRead; //当前工程...
分类:
其他好文 时间:
2014-07-25 13:51:52
阅读次数:
332
//长方形的类的声明与实现#import @interface Rect2 : NSObject{// float chang;// float w;}@property float chang;@property float w;- (float)sizeOfRect;@end#imp...
分类:
其他好文 时间:
2014-07-24 10:04:16
阅读次数:
221
先看下面一个例子#import #import "AppDelegate.h"@interface Something : NSObject- (void)doWithError:(NSError **)outError;@end@implementation Something- (void)do...
分类:
其他好文 时间:
2014-07-23 16:44:01
阅读次数:
212
1.最直接的方法performSelector:withObject:afterDelay:这种方法的缺点:每次要为延时写一个方法2.使用类别,用BOLCK执行[代码]c#/cpp/oc代码:01@implementation NSObject (PerformBlockAfterDelay)020...
分类:
移动开发 时间:
2014-07-23 15:43:39
阅读次数:
168
属性定义@interface Nothin : NSObject@property NSString *prop;@end访问属性 Nothin *nothin = [Nothin new]; //get [nothinprop]; //set [nothin setProp: @"Nothin"]...
分类:
其他好文 时间:
2014-07-22 08:13:34
阅读次数:
302
说到复合与存取,我做完这个例子,感觉就是类的集合,也没什么东西。
主Car类:
#import "Engine.h"
#import "Tire.h"
//汽车
@interface Car : NSObject
{
Engine *engine;
Tire *tires[4];
}
-(Engine *)engine;
-(void)setEngine:(Engine *) ...
分类:
其他好文 时间:
2014-07-21 16:42:12
阅读次数:
230
Objective-C类、对象、方法1.编写一个复数类:#import @interface Complex: NSObject //类声明,Complex继承NSObject{ int iReal;//成员变量声明,在括号内 int iImag;}//成员函数声明,在括号外-(...
分类:
其他好文 时间:
2014-07-19 19:07:42
阅读次数:
213
类1.合成存取器方法@property 成员变量@synthesize 成员变量可以让编译器自动合成 设置和获取函数的方法,不用手动生成set成员变量,Get成员变量@interface Complex : NSObject{ int iReal,iImag;}@property int iReal...
分类:
其他好文 时间:
2014-07-19 15:08:15
阅读次数:
224
1、在Cocoa Touch中创建ZYViewController视图控制器,在User Interface中创建一个view的bluleView.xib文件2、点击bluleView.xib,然后Option+Command+3打开身份检查器,将默认的NSObject改成ZYViewControl...
分类:
移动开发 时间:
2014-07-18 23:20:23
阅读次数:
586
.h文件
/**
* MD5加密工具
*/
#import
@interface MD5Tools : NSObject
/**
* MD5加密
*/
+(NSString *)md5:(NSString *)value;
/**
* 密码MD5+手机号后4位 ,在作MD5加密
*/
+(NSString *)md5Psd:(NSString *)password...
分类:
其他好文 时间:
2014-07-18 22:18:27
阅读次数:
234