- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[U...
分类:
移动开发 时间:
2014-09-12 17:12:03
阅读次数:
235
NSButton *tempBtn = [[NSButton alloc] initWithFrame: NSMakeRect(200, 200, 20, 20)];[tempBtn setButtonType: NSMomentaryPushInButton];[tempBtn setBezelS...
分类:
其他好文 时间:
2014-09-12 16:41:23
阅读次数:
482
UIScrollView中添加了一个手势 UITapGestureRecognizer *_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(foregroundTapped:)]...
分类:
移动开发 时间:
2014-09-12 11:39:13
阅读次数:
184
一、原型:extern void *malloc(unsigned int num_bytes);头文件:#include 或 #include (注意:alloc.h 与 malloc.h 的内容是全然一致的。)功能:分配长度为num_bytes字节的内存块说明:假设分配成功则返回指向被分配内.....
分类:
其他好文 时间:
2014-09-11 22:13:52
阅读次数:
225
一、构造方法的作用用来初始化对象的成员变量值,当我们在创建对象时,需要一些成员变量具有一定的初始值,这个时候就要用到构造方法。利用类的new方法可以创建一个对象,这个new方法其实是分两步来完成创建对象的。1> 调用+alloc来分配存储空间 Person *p1 = [Person alloc];...
分类:
其他好文 时间:
2014-09-10 23:51:11
阅读次数:
276
有的时候我们可能会选用 UIText 或 UILabel 来显示 HTML 代格式的文字。NSAttributedString *html = [[NSAttributedString alloc]initWithData:[NSLocalizedString(@"comment", nil) da...
分类:
移动开发 时间:
2014-09-10 17:37:20
阅读次数:
141
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0
diskCapacity:0
...
分类:
Web程序 时间:
2014-09-10 09:38:10
阅读次数:
223
Dictionary 写入: if ([self.currentUserAccount length] > 0) { KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc]initWithIdentifier:@"usera....
分类:
移动开发 时间:
2014-09-09 19:46:59
阅读次数:
217
单例模式,就是一个类始终只有一个实例,不管如果copy还是retain还是alloc等等,都只有一个实例。为什么?有什么好处?
简单来说:
a:有的东西只能有一个,那就必须用单例;
b:单例的好处就是不会有多余的实例,所以节约内存;
c:因为只有一个单例,所以易于管理多线程对它的访问。...
分类:
其他好文 时间:
2014-09-09 18:21:19
阅读次数:
157
#define kEncryptKey @"com.person.projectname"- (NSData *)encryptData:(id)dic{ NSMutableData *data = [[NSMutableData alloc] init]; NSKeyedArchive...
分类:
移动开发 时间:
2014-09-09 16:01:08
阅读次数:
197