摘要: 升级iOS8了,突然发现定位服务无法开启。于是乎网上找答案。中文答案网上搜索一大圈,tmd都以讹传讹的用这个字段:NSLocationWhenInUseDescription终于在stackoverflow找到答案:http://stackoverflow.com/questions/2485012... 阅读全文
posted @ 2014-09-23 16:13 馒不头 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 一些基本排序算法的C实现void Swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;}#pragma mark - Bubblevoid BubbleSort(int a[], int n){ int i, j, temp; for (j = n-1; j > 0; j--) { for (i = 0; i a[i+1]) { temp = a[i+1]; a[i+1] = a[i]; a[i] = ... 阅读全文
posted @ 2014-04-04 11:46 馒不头 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 参考:http://guxiaojje.blog.163.com/blog/static/14094229120131510359399/http://www.buildapp.net/iphone/show.asp?id=10192矩阵的基本知识:struct CGAffineTransform{ CGFloat a, b, c, d; CGFloat tx, ty;};CGAffineTransform CGAffineTransformMake(CGFloat a,CGFloat b,CGFloat c,CGFloat d,CGFloat tx,CGFloat ty);为了把二维图形的变 阅读全文
posted @ 2013-06-18 16:43 馒不头 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 如图示,加入run script到build phasesSHELL中代码:REV=`svnversion -nc | /usr/bin/sed -e 's/^[^:]*://;s/[A-Za-z]//'`BASEVERNUM=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString""${INFOPLIST_FILE}"`/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $REV""${INF 阅读全文
posted @ 2013-06-13 09:19 馒不头 阅读(165) 评论(0) 推荐(0) 编辑
摘要: GPUImage是一个非常棒的图像处理的开源库,里面提供了非常非常多的滤镜效果来加工图片。不过就是因为太多效果了,而且对于程序员来说,那么多效果并不清楚知道要用那一个。于是我就使用提供的默认值,加上对滤镜的命名的理解,粗略简单地对GPUImage.h里引用的各个滤镜进行简要说明。这样方便以后找到想要的滤镜效果。其中可能有理解错误,或者表达不准确的地方还请大家斧正。其中有些效果需要使用摄像头才可能有比较理想的效果。附上注释的GPUImage.h代码:#import "GLProgram.h"// Base classes#import "GPUImageOpenGL 阅读全文
posted @ 2013-06-06 16:10 馒不头 阅读(2035) 评论(0) 推荐(1) 编辑
摘要: 一有用的 UIImage 扩展,支持(等比例)放大和旋转可在许多 App 中使用。UIImage-Extensions.h#import <Foundation/Foundation.h>#import <UIKit/UIKit.h>CGFloat DegreesToRadians(CGFloat degrees);CGFloat RadiansToDegrees(CGFloat radians);@interface UIImage (JQ_Extensions)- (UIImage *)imageAtRect:(CGRect)rect;- (UIImage *)im 阅读全文
posted @ 2013-05-17 12:20 馒不头 阅读(2241) 评论(0) 推荐(1) 编辑
摘要: A SpaceManager Game在学习闲逛中,发现了cocos2d-iphone 官方网站中一篇介绍Chipmunk物理引擎并工具化的教程。在网上搜了下,并无中文翻译,并且Chipmunk物理引擎的相关资料也非常少,于是产生了翻译此篇blog的想法。这几天公司的项目比较忙,距离上一篇基础的SpaceManager翻译文章(The Chipmunk SpaceManager(Chipmunk物理引擎管理类))过了1个多星期这篇才有时间翻译出来。原文相关:A SpaceManager GamePublished by mobilebros on January 24, 2011 in chi 阅读全文
posted @ 2012-05-24 15:25 馒不头 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 在学习闲逛中,发现了cocos2d-iphone 官方网站中一篇介绍Chipmunk物理引擎并工具化的教程。在网上搜了下,并无中文翻译,并且Chipmunk物理引擎的相关资料也非常少,于是产生了翻译此篇blog的想法。原文相关:The Chipmunk SpaceManagerPublished by mobilebros on March 15, 2010 in chipmunk and cocos2d. 20 CommentsTags: chipmunk, cocos2d, spacemanager, tutorial.TweetCocos2d-iphone and Chipmunk之前当 阅读全文
posted @ 2012-05-10 09:17 馒不头 阅读(830) 评论(0) 推荐(0) 编辑