
ios
wangql48
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于UIGestureRecognizerState
源代码里有注释,为了避免忘掉,作一下笔记 UIGestureRecognizerState的定义如下 typedef enum { UIGestureRecognizerStatePossible, UIGestureRecognizerStateBegan, UIGestureRecognizerStateChanged, UIGestureRecogn原创 2012-02-08 22:01:15 · 15848 阅读 · 0 评论 -
如何忽略https认证
使用一个私有API可以忽略证书无效等问题 [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]]; 注意这是一个私有API,使用这个代码的APP将会被苹果商店拒绝。 另提供2个合法的方式,NSURLConnectionDelegate的 - (BOOL)connection:(NSURLCon原创 2012-03-02 22:48:07 · 4358 阅读 · 0 评论 -
视图之间坐标点的转换
我们在转换一个点在两个不同的视图中的坐标时经常用到 UIView的方法 convertPoint:toView: 或者是 convertPoint:fromView: [aView convertPoint:p toView:anotherView]是指将p相对aView的坐标转换为相对anotherView的坐标 比如说aView是原点(0,0), 宽高(1024, 768)原创 2012-03-28 00:34:27 · 9933 阅读 · 0 评论 -
cocos2d的暂停/恢复
cocos2d提供了比较重要的有3种暂停、恢复的机制 分别是CCDirector, CCActionManager, CCScheduler提供的 1 CCDirecotor: -(void) pause; -(void) resume; 导演类的暂停恢复是针对整个运行场景的,所以如果我们还想在暂停的画面上做其他事情,不推荐这种方法 2 CCActionMana原创 2012-03-22 02:31:55 · 5878 阅读 · 0 评论 -
cocos2d触摸点坐标转换标准写法
-(BOOL) ccTouchBegan:touch withEvent:event { CGPoint touchLocation = [touchlocationInView: [touchview]]; touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation]; CGPoint local转载 2012-05-02 09:32:47 · 1676 阅读 · 0 评论 -
ObjC内存管理推荐写法
在头文件中生命一个自动retain的property @property (nonatmonic, retain) MyClass *instance; 在.m文件中,用.操作符来赋值 @synthesize instance; -(id) init { self = [super init]; if (self) { self.instance = [[MyClas原创 2013-02-18 01:27:58 · 757 阅读 · 0 评论 -
关于释放对象以后为什么要=nil
有些时候释放对象是这样写的 [ptr release]; ptr = nil; 这是为什么呢? 如果要重复使用同一个指针*ptr, 在释放掉上一个对象以后, 最好是ptr = nil一下, 这样可以避免在if (ptr)的时候出现返回值是YES的错误。 如果不是重复使用的话,那就没必要= nil了。 ==============2/18 update======原创 2012-07-18 15:23:32 · 1305 阅读 · 0 评论