摘要: - (UIImage*) imageWithUIView:(UIView*) view{UIGraphicsBeginImageContext(view.bounds.size);CGContextRef ctx = UIGraphicsGetCurrentContext();[view.layer renderInContext:ctx];UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();return tImage;} 阅读全文
posted @ 2012-01-29 11:09 tinyqf 阅读(418) 评论(0) 推荐(0)
摘要: UIImageView *imageView =[[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)]; imageView.image=[UIImageimageNamed:@"filter_laozhaopian_a.png"]; imageView.userInteractionEnabled = YES; UITapGestureRecognizer *singleTap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@ 阅读全文
posted @ 2011-11-23 15:05 tinyqf 阅读(7707) 评论(2) 推荐(0)
摘要: 直奔主题。-》》》》》》》》》》》》》》既然要使用touchXml解析xml。那么首先应该下载touchxml类库。猛击我。点击左边的zip下载。打开下载好的类库。找到里面的Source文件夹。这就是需要用到的类库。然后在xcode建立一个项目。在项目中新建一个文件夹,名字随便,就叫touchxml吧。然后将Source中的文件拖入touchxml文件夹中。尽量将Copy itmes into destination group’s folder(if needed)勾选上。 这时候,你编译他是不会通过的。你需要首先添加libxml2 library。右键Frameworks。通... 阅读全文
posted @ 2011-11-13 17:08 tinyqf 阅读(6227) 评论(0) 推荐(0)
摘要: Objective-C数组相关操作。 // insert code here... NSLog(@"数组"); //指定多个字符串创建数组 NSArray *array; array=[NSArray arrayWithObjects:@"0-asd",@"1-fds",@"2-哈咯",@"3-个人",nil]; //数组的长度 NSLog(@"数组长度%d",array.count); //通过索引取得对象 for(int i=0;i<array.count;i++) 阅读全文
posted @ 2011-10-21 11:28 tinyqf 阅读(2026) 评论(0) 推荐(0)
摘要: 纪录下些许关于Objective-C字符串处理的函数; NSLog(@"字符串处理"); //获得字符串长度 NSString* str1=@"MAC OS Pro"; NSLog(@"长度是 %d",[str1 length]); //两个字符串连接 NSString* str2=@"MAC OS Pro"; NSString* str3=@" Leopard"; NSString* str4=[str2 stringByAppendingString:str3]; NSLog(str4,ni 阅读全文
posted @ 2011-10-20 14:04 tinyqf 阅读(10719) 评论(0) 推荐(2)
摘要: 记载关于Objective-C创建字符串的一些方式代码。 //用@符号职能定义含有英文和数字的NSSting实例; NSString* string=@"znglish strings"; NSLog(string,nil); //创建中文字符串 NSString* string1; string1=[NSString stringWithCString:"您好!这是中文字符串," encoding:NSUTF8StringEncoding]; NSLog(string1,nil); //指定NSString的实例来创建字符串。 NSString* st 阅读全文
posted @ 2011-10-19 22:42 tinyqf 阅读(573) 评论(0) 推荐(0)
摘要: 在学习Object-c的时候,按着书上的代码出现“warning: format not a string literal and no format arguments”;虽然是个警告,但是看着很烦人,记录下处理方法。NSString* string=@"strings";NSLog(string,nil);这样就不会出现这个警告了。2011年10月19 阅读全文
posted @ 2011-10-19 22:18 tinyqf 阅读(2319) 评论(0) 推荐(0)