2012年4月17日

擦除ImageView的圆形橡皮擦

摘要: View Code 1 CGPoint currentPoint = [touch locationInView:imageView]; 2 UIGraphicsBeginImageContext(self.imageView.frame.size); 3 [imageView.image drawInRect:imageView.bounds]; 4 5 CGContextRef context = UIGraphicsGetCurrentContext(); 6 CGRect cirleR... 阅读全文

posted @ 2012-04-17 19:25 AXZON 阅读(299) 评论(0) 推荐(0) 编辑

2012年2月21日

NSNotificationCenter

摘要: View Code 1 1. 定义一个方法 2 3 -(void) update{ } 4 5 2. 对象注册,并关连消息 6 7 [[NSNotificationCenter defaultCenter] 8 9 addObserver:self selector:@selector(update) name:@"update" object:nil] 10 11 3. 在要发出通知消息的地方 12 13 [[NSNotificationCenter defaultCenter] 14 15 ... 阅读全文

posted @ 2012-02-21 08:57 AXZON 阅读(317) 评论(0) 推荐(0) 编辑

2012年2月12日

GDataXML的一些简单示例。

摘要: View Code 1 +(NSDictionary *) XmlAnalysisWithString:(NSString *) URLString 2 3 { 4 5 NSError* error; 6 7 NSMutableDictionary * dataDic = [NSMutableDictionary dictionary]; 8 9 //拿出xml文件内容10 11 NSURL * myURL = [NSURL URLWithString:URLString];12 13 NSString* fileContent = [[NSString alloc] initWit... 阅读全文

posted @ 2012-02-12 12:45 AXZON 阅读(183) 评论(0) 推荐(0) 编辑

2012年2月11日

给项目添加GDataXML。

摘要: 库中加入libxm 从http://code.google.com/p/gdata-objectivec-client/downloads/list下载“gdata-objective-c client library.” 2. 解压缩文件,找到Source\XMLSupport,并且将其中的GDataXMLNode.h 和 GDataXMLNode.m文件拖到项目中 3. 选中项目,选中“Build Settings”标签页 4. 将Build Settings页中,顶部的“Basic”标签切换到“All” 5. 找到“Paths\Header Search Paths”项,并添... 阅读全文

posted @ 2012-02-11 21:49 AXZON 阅读(151) 评论(0) 推荐(0) 编辑

2012年2月10日

读/写文件

摘要: View Code 1 NSArray *paths; 2 NSString *arrayPath; 3 NSString *urlString; 4 5 paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 6 NSUserDomainMask, YES);//搜索沙盒路径下的document文件夹。 7 arrayPath = [[paths objectAtIndex:0] 8 ... 阅读全文

posted @ 2012-02-10 15:16 AXZON 阅读(120) 评论(0) 推荐(0) 编辑

得到沙盒的路径

摘要: NSLog(@"...%@",NSHomeDirectory()); 阅读全文

posted @ 2012-02-10 14:49 AXZON 阅读(86) 评论(0) 推荐(0) 编辑

MAC OS隐藏/显示 文件夹

摘要: 终端输入:显示defaults write com.apple.finder AppleShowAllFiles TRUEkillall Finder隐藏defaults write com.apple.finder AppleShowAllFiles FALSEkillall Finder 阅读全文

posted @ 2012-02-10 14:48 AXZON 阅读(144) 评论(0) 推荐(0) 编辑

奇葩问题。程序突然无法运行了

摘要: Couldn't register com.mycompany.MyApp with the bootstrap server. Error: unknown error code.This generally means that another instance of this process was already running or is hung in the debugger.1. 重新Xcode2. 重启device3. clean4. rebuild 阅读全文

posted @ 2012-02-10 14:46 AXZON 阅读(145) 评论(0) 推荐(0) 编辑

2012年2月9日

UIImage保存为JPG,PNG的方法

摘要: View Code 1 / Create paths to output images 2 NSString *pngPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.png"]; 3 NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.jpg"]; 4 5 // Write a UIImage to JPEG with minimum 阅读全文

posted @ 2012-02-09 23:55 AXZON 阅读(384) 评论(0) 推荐(0) 编辑

收集的一些常用的转换。

摘要: View Code 1 . NSData 与 NSString 2 3 NSData-> NSString 4 5 NSString *aString = [[NSString alloc] initWithData:adataencoding:NSUTF8StringEncoding]; 6 7 8 9 NSString->NSData 10 11 NSString *aString = @"1234abcd"; 12 13 NSData *aData = [aString dataUsingEncoding: NSUTF8StringEncoding];.. 阅读全文

posted @ 2012-02-09 23:53 AXZON 阅读(193) 评论(0) 推荐(0) 编辑

导航