摘要:本文参考:iOS Application Programming Guide – The Application Runtime EnvironmentiOS运行环境的设计目标,快速安全的执行应用程序。快速启动,短暂使用一个典型情况是,用户从口袋中拿出设备,只使用几秒钟或者几分钟,然后再次放在口袋里。 这要求:快速启动应用使用后能尽快退出特殊的系统行为在很多地方,iOS都和mac os x特性和行为一样。但是有些情况和mac os x不同:虚拟内存系统管理程序内存,iOS和mac os x拥有相同的特性和行为方式。在iOS下,每个程序仍然拥有自己的虚拟地址空间,但是和mac os x不同的是, 阅读全文
keychain services on iPhone
2010-12-29 17:41 by Tracy E, 1706 阅读, 0 推荐, 收藏, 编辑
摘要:keychain services on iPhone:# When a user backs up iPhone data,the keychain data is backed up but the secrets in the keychain remain encrypted in the backup.The keychain password is not included in the backup.Therefore,passwords and other secrets stored in the keychain on the iPhone cannot be used b 阅读全文
iphone获取地址的详细信息
2010-12-20 17:17 by Tracy E, 800 阅读, 0 推荐, 收藏, 编辑
摘要:- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate {if (self = [super init]) {// Custom initialization reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate];reverseGeocoder.delegate = self;[reverseGeocoderstart]; //⋯⋯}returnself;} #pragma mark MKReverseGeocoderDelegate 阅读全文
Objective-C加密算法
2010-11-15 08:06 by Tracy E, 5110 阅读, 1 推荐, 收藏, 编辑
摘要:#import #import //MD5- (NSString*)md5Hash { unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5([self bytes], [self length], result); return [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", result[0], result[1], result... 阅读全文
iphone支持的所有字体
2010-11-04 17:39 by Tracy E, 3296 阅读, 0 推荐, 收藏, 编辑
摘要://打印iphone支持的所有字体NSArray *familyNames = [UIFont familyNames];for(NSString *familyName in familyNames){ NSLog(@"%@", familyName); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for(NSString *fontName in fontNames) { NSLog(@"\t%@", fontName); }}Arial HebrewAr... 阅读全文
常用正则表达式大全
2010-10-28 19:53 by Tracy E, 722 阅读, 0 推荐, 收藏, 编辑
摘要:匹配中文字符的正则表达式: [u4e00-u9fa5] 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 匹配双字节字符(包括汉字在内):[^x00-xff] 评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) 匹配空白行的正则表达式:ns*r 评注:可以用来删除空白行 匹配HTML标记的正则表达式:<(S*?)[^>]*>.... 阅读全文
Singleton Pattern in Objective-C
2010-10-27 19:58 by Tracy E, 503 阅读, 1 推荐, 收藏, 编辑
摘要:Creating a Singleton InstanceA singleton object acts as a kind of control center, directing or coordinating the services of the class. Your class should generate a singleton instance rather than multiple instances when there is conceptually only one instance (as with, for example, NSWorkspace). You 阅读全文
封装的一个用来下载图片的类
2010-10-20 09:33 by Tracy E, 592 阅读, 1 推荐, 收藏, 编辑
摘要://// ImageDownloader// Created by Tracy E on 10-9-5.// Copyright 2010 tracy.cpp@gmail.com. All rights reserved.// @protocol ImageDownloaderDelegate;@interface ImageDownloader : NSObject{ NSString *imageURL; NSMutableData *activeDownload; NSURLConnection *imageConnection; id <ImageDownloaderD... 阅读全文
获取iphone的设备信息
2010-10-15 09:30 by Tracy E, 741 阅读, 1 推荐, 收藏, 编辑
摘要:Available Properties in UIDeviceuniqueIdentifier – identifier guaranteed to be unique for every devicename – arbitrary name found in General > About setting on devicesystemName – name of the OS running on the devicesystemVersion – current version of the OSmodel- model, such as ”iPhone” or ”iPod t 阅读全文
iphone-地理位置相关
2010-10-14 19:49 by Tracy E, 459 阅读, 1 推荐, 收藏, 编辑
摘要:调用google map应用: NSString *strUrl = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@",[[stationArr objectAtIndex:tag] _position]]; strUrl = [strUrl stringByAddingPercentEscapesUsingEncodin... 阅读全文