alex
alex09 · 共 133 篇文章
cocos2d 截屏幕代码
-(UIImage *) glToUIImage { NSInteger myDataLength = 320 * 480 * 4; // allocate array and read pixels into it. GLubyte *buffer = (GLubyte *) malloc(myDataLength); glReadPixels(0, 0, 320, 480, GL_RGBA, GL_UNSIGNED_BYTE, buffer); // gl renders "upside down" so swap top to bottom into new array. // the…
2011-10-09T16:48:36Z · 移动开发 · 评论(0)
一行代码让App运行时iPhone不会进入锁屏待机状态
如果你不希望应用运行时 iPhone 进入锁屏待机状态,加入下面这行代码即可 setIdleTimerDisabled:YES];
2011-10-06T19:53:56Z · 移动开发 · 评论(0)
Can’t set breakpoints in Xcode 4 and debugger does not stop
http://www.weston-fl.com/blog/?p=2337
2011-10-06T19:36:37Z · 移动开发 · 评论(0)
Lion 隐藏了library的问题
Mac OS X Lion为了增强所谓的安全性,隐藏了一些系统文件夹,比如Library(资源库)。如此自作多情,使用起来却不太方便,特别是在中国这块神奇的土地 上,我们随时可能要进Library里去干一些什么事。当然可以在前往里输入文件夹路径打开文件夹,但普通用户谁又知道、谁又喜欢去输那么长一段英文呢? 如何显示?在终端中输入以下命令回车即可: chflags nohidden ~/Library 如果想隐藏: chflags hidden ~/Library 对于其他文件夹,只要相应更改后面的路径即可。
2011-09-02T15:10:45Z · 移动开发 · 评论(0)
xcode中armv6与armv7
apple 通用二进制应用程序,含多种处理器或架构的二进制,如x86或x64,arm11或a8 armv7与armv6是指指令或架构的CPU, armv6是iphone3gs以前arm11 cpu使用的指令集 armv7是iphone3gs及以后、iphone4、ipad,cortex a8 cpu使用的指令集 from : http://hackbin.blog.163.com/blog/static/178163023201141144454113/
2011-08-24T16:50:23Z · 移动开发 · 评论(0)
Declaring the Background Tasks You Support
Support for some types of background execution must be declared in advance by the application that uses them. An application declares this support by including the UIBackgroundModes key in its Info.plist file. Its value is an array that contains one or more strings with the following values: audio.…
2011-08-13T23:03:45Z · 移动开发 · 评论(0)
iPhone Backgrounder终极教程
有很多人说iPhone 4开始 4.0以后的固件已经支持后台运行了,为什么还需要Backgrounder???? 我想说双击Home键出来的叫做最近运行程序列表,出现在这个列表里面的唯一、充分且必要条件是最近运行过的程序,跟任何别的因素没有关系。而且列表里面的图标是按最近运行的顺序排序的。这个列表里面的程序有可能是在后台驻留的,也有可能是已经完全退出的,还有可能是真后台还在继续运行的。总之,都有可能,因为是否后台跟是否出现在这个列表无关。我们可以肯定的只有一点:不在这个列表里面的程序必定是已经完全退出了的。在后台驻留但不出现在最近程序列表里面这种情况是不允许发生的。 如果你在这个列表里面手动…
2011-08-12T23:43:07Z · 移动开发 · 评论(0)
NSMutableArray 中排序
使用sortedArrayUsingComparator方法 NSArray *sorted = [_scores sortedarrayusingcomparator:^(id obj1, id obj2){ if ([obj1 iskindofclass:[score class]] && [obj2 iskindofclass:[score class]]) { Score *s1 = (Score*)obj1; Score *s2 = (Score*)obj2; if (s1.points > s2.points) { return (NSComparisonResult)NSOrd…
2011-07-24T14:02:18Z · 移动开发 · 评论(0)
cocos2d Loading的处理
(id) init { self = [super init]; if ( self ) { // Add the Label (in cocos2D universe) BitmapFontAtlas *label = [bitmapfontatlas bitmapfontatlaswithstring: @"initializing game" fntfile: @"comic_atlas.fnt" alignment: uitextalignmentcenter]; label.position = ccp(240, 160); label.opacity = 0; [self add…
2011-07-11T12:42:44Z · 移动开发 · 评论(0)
CORE ANIMATION的介绍
UIView layer The view’s Core Animation layer used for rendering. (read-only) This property is never nil. The actual class of the object is determined by the value returned by the layerClass method. The view is the layer’s delegate. Warning: Since the view is the layer’s delegate, you should never m…
2011-06-28T18:48:12Z · 移动开发 · 评论(0)
Programming Apple Push Notification Services
http://mobiforge.com/developing/story/programming-apple-push-notification-services
2011-06-28T13:09:16Z · 移动开发 · 评论(0)
iPhone的2D/3D游戏引擎
近日在学习iPhone游戏开发,对于2D和3D游戏引擎的使用大费了一番周折。这方面的内容国内网站还很少,只能通过google来查找国外的一些网站资料。还好,总算找到了适合自己和团队学习的引擎。 先对可选项列举如下: 经过以上比对,我首选了开源的工具。2D的游戏引擎使用cocos2d,3D的游戏引擎使用SIO2。 Unity3D试用了Mac版本的,也看了不少视频,学会了基本的使用,不过目前Mac版本没有破解,只有30天的试用期限。另外,使用Unity iPhone的话,Unity必须是注册版才行,所以暂时无法使用Unity iPhone。 选择cocos2d和SIO2这两款主要是为了前期学习简…
2011-06-13T14:58:21Z · 移动开发 · 评论(0)
how to debug EXC_BAD_ACCESS on iPhone
http://www.codza.com/how-to-debug-exc_bad_access-on-iphone
2011-06-09T10:15:45Z · 移动开发 · 评论(0)
Topic : Foundation/Foundation.h UIKit/UIKit.h No such file or directory
http://discussions.apple.com/thread.jspa?threadID=1734845
2011-03-18T22:36:19Z · 移动开发 · 评论(0)
objective c 编程规范
Google的Objective-C编码规范 http://bukkake.iteye.com/blog/695492
2011-03-07T23:58:52Z · 移动开发 · 评论(0)