- 博客(118)
- 资源 (1)
- 收藏
- 关注
原创 通过例子分析Cocos2d-x的Resolution
例子:Use images for iPhone 5 in iPad.假设原图像大小是:1136 x 640 (For iPhone 5)Screen中实际的坐标系统是:1024 x 768 (iPad)Screen中预想的坐标系统是:480 x 320 (iPhone坐标)设置预想坐标和显示方式:CCEGLView::sharedOpenGLView()->s
2013-07-13 16:58:59
1226
转载 深度解析Objective-C内存管理教程
深度解析Objective-C内存管理教程是本文要介绍的内容,不多说,来看内容。iPhone系统中的Objective-C的内存管理机制是比较灵活的,即可以拿来像C/C++一样用,也可以加个AutoreleasePool让它升级为半自动化的内存管理语言。当然,也不能拿JAVA虚拟机中的全自动化GC来比引用计数是实例对象的内存回收唯一参考引用计数(retainCount)是Objec
2013-05-21 09:33:15
625
转载 详解Objective-c Block应用
详解Objective-c block应用是本文要介绍的内容,主要介绍的是Objective-c block应用,不多说,先来看详细内容。Apple在C, Objective-C, C++加上Block這個延申用法。目前只有Mac 10.6 和iOS 4有支援。Block是由一堆可執行的程式組成,也可以稱做沒有名字的Function (Anonymous function)。如果是Ma
2013-05-21 09:31:31
532
转载 Using Git for Unity 3D Source Control
Before I start; using Git to control source for Unity is not directly supported (though the concept is the same). Use this at your own risk and back up all of your data before attempting it.Hell
2013-05-04 21:39:51
851
转载 iOS UIControl 几个事件的说明
在控件事件中,简单解释下下面几个事件。说明:由于是在“iOS 模拟器”中测试的,所以不能用手指,只能用鼠标。1)UIControlEventTouchDown指鼠标左键按下(注:只是“按下”)的动作2)UIControlEventTouchDownRepeat指鼠标左键连续多次重复按下(注:只是“按下”)的动作,比如,鼠标连续双击、三击、……、多次连击。说明:多次重复按下时
2013-04-05 13:28:35
583
转载 Outlet in iOS and MacOS
Outlets - Property vs. Instance VariableWhen we were writing our iPhone programming book, all of Apple's sample code and documentation used the IBOutlet keyword exactly how we had always used
2013-04-05 13:27:05
838
转载 Class Cluster
UIButton is not a class cluster at all. A class cluster is represented by a public abstract class, that means no instance variables, with a bunch of private concrete subclasses that provide the impl
2013-04-04 15:36:40
714
转载 ASIHTTPRequest with Cookie
// creating the URLNSURL *_server_url = [NSURL URLWithString:@"http://my_computer.local/";];// creation the cookieNSHTTPCookie *cook = [NSHTTPCookie cookieWithProperties: [NSDictionary dicti
2013-04-01 14:22:01
560
原创 ASIHTTPRequest with Https
[request setValidatesSecureCertificate:NO]Since this is getting some upvotes, I'd just like to add that this might not be the best approach for valid SSL certificates. The one I was using was a self
2013-04-01 14:18:59
522
转载 AndEngine环境配置及extension,AndEngineExamples导入
最近在看AndEngine,总结点东西备忘!其实AndEngine的配置相比较Libgdx(Android下的另一款游戏引擎),还是很好配置的!可能唯一麻烦点的是配置AndEngineExamples时导入各种扩展吧!详细步骤如下:1.git下载得到AndEngine源码,需要的8个extension,学习要用的AndEngineExamples(没有文档,所以
2013-03-30 20:00:42
765
转载 Cocos2d-x Android配置
大家都知道Cocos2d-X是个多平台支持的游戏引擎,那么当今最主流的手机系统是iOS和Android,所以少不了Android的童鞋以及iOS的童鞋都偏向于Cocos2d-X引擎,而且更多的Android开发者还是习惯的IDE使用Eclipse,如今Cocos2d-X配置在Eclipse环境中的教程很少,那么Himi今天就分享自己在Mac os下搭建起Eclipse Android-Cocos2
2013-03-28 14:32:06
1165
转载 Select text in vim
text selectionIf you want to do the same thing to a collection of lines, like cut, copy, sort, or format, you first need to select the text. Get out of insert mode, hit one of the options below, and
2013-03-25 17:37:25
780
转载 ASIHTTPRequest with SSL
How to implement a https connection with SSL and ASIHTTPRequest?To do ssl with ASIHTTPRequest, you just need to pass a https url instead of a http one.Are there some special steps to do? you d
2013-03-08 12:01:57
887
转载 SSL(Secure Socket Layer)
前段时间项目的关系学习了下SSL,有一些心得体会和疑惑打算一并记录下来和大家分享和讨论一下。这部分内容打算分成如下一些章节来写:第一章. 对SSL的基本概念和框架的介绍第二章.对SSL握手协议的研究(part-1 )第三章.对SSL握手协议的研究(part-2)第四章.对SSL握手协议细节和实现的介绍第五章.对SSL记录协议细节和实现的介绍第六章.对SSL的安全性分析第七章.举例一种将
2013-03-08 11:11:32
685
转载 Keychain VS NSUserDefaults
Encryption will give you some security. The problem is your program would also have to decrypt the password, which means it must have the key stored in it somewhere. This will make it vulnerable to re
2013-03-08 09:18:17
981
转载 NSUserDefaults
The NSUserDefaults docs state: "NSUserDefaults caches the information to avoid having to open the user’s defaults database each time you need a default value."Therefore it's no different to sett
2013-03-07 17:57:17
641
原创 App 申请时In App Purchase注意事项
最近,App申请被拒,原因是App In Purchase时返回receip无效的错误。经过调查发现,apple在审查的时候用的是sandbox的帐号,所以你必须在code中,先用production的url进行receipt的验证,如果返回21007的错误,再用sandbox的url进行验证。见Apple文档说明:How do I verify my receipt (iOS
2013-03-07 16:05:44
1309
转载 ASIHTTPRequest "A connection failure occurred" error
iOS Development: Why do I always get the “A connection failure occurred” on the 1st attempt, but success on the next?I'm using the ASIHTTPRequest lib in my iOS app to make RESTful requests to my
2013-03-01 09:31:40
3589
转载 【iPhone】Push Notificationの実装方法
【iPhone】Push Notificationの実装方法Posted by: daichi / Category: iphone開発新作でTwitter,はてな,Google Readerから横断的に情報収集し、マルチポストするアプリを作っているのですが、そこでTwitterのリプライPush機能を実装したので、Push Notificationを実装する方法をまとめてみま
2013-02-27 14:22:05
2252
转载 Create an ad-hoc provisioning profile
Create an ad-hoc provisioning profileFrom time to time during the project, your developer will send a preview copy of the application. Because it's not coded for the AppStore yet, he has to us
2013-02-25 11:50:47
1319
原创 Tools Workflow Guide for iOS
Memo:https://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/00-About_the_iOS_Application_Development_Workflow/introduction.html
2013-02-25 11:18:04
486
转载 CFBundleVersion vs CFBundleShortVersionString
Questions:What's the difference betweenversion number in itunes connect(which you have to supply when you submit an update)bundle version in xcodebundle versions string, shortAnswer:
2013-02-25 10:44:50
534
原创 Memory management in block
Memory management in blockBlockの具体的な使い方はhttps://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.htmlを参考してください。Blockの使うのは二つ
2013-02-22 16:06:05
385
原创 Use git cherry-pick
If you used commit -a -m to commit other branch's changes(branch A) to the current branch(branchB) by mistake, you want to put the last commit back branch A, so use git cherry-pick logidwhere, log
2013-02-21 12:13:17
397
原创 Manage objective c object memory in Block
Look at the document from Apple:When a block is copied, it creates strong references to object variables used within the block. If you use a blockwithin the implementation of a method:●If you ac
2013-02-20 17:26:06
569
转载 Block 的内存管理
block 有什么意义,特点等等,这些东西,实在是太复杂了,这里只是简单的总结一下block的内存管理。而且也仅仅限于objective-C的部分Block memoryblock 的内存管理,应该是最头疼的地方,就用这个来自WWDC的例子来解释一下吧。当程序运行到这里时,stack 空间中有 shared 变量和 captured 变量。这里可以看出,__
2013-02-20 16:06:50
413
转载 iPhone: Detecting user inactivity/idle time since last screen touch
Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.There's this s
2013-02-15 16:55:31
860
转载 Archiving Objective-C Objects with NSCoding
For the seasoned Cocoa developer, this is a piece of cake. For newer developers, this can be a real pain, especially if you don't know what you're looking for. I get this question a decent amount, so
2013-02-14 08:54:36
366
转载 nil / Nil / NULL / NSNull
Understanding the concept of nothingness is as much a philosophical issue as it is a pragmatic one. We are inhabitants of a universe of somethings, yet reason in a logical universe of existential unce
2013-02-14 08:52:37
814
原创 Objective C 类变量的声明
Objective C中类变量的声明一般有两种方式:1)instance variable2)property方式声明instance variable方式声明如下:@interface MyClass : NSObject { NSString * _name;}如果你不想使用自动声明的set/get函数,则可以用这种方式。instance var
2013-02-03 17:55:31
1052
原创 如何判断一个类是否实现了某个protocol
使用-conformsToProtocol:函数,具体用法如下:@protocol MyProtocol @required- (void)onUpdate;@end@interface ProtocolTest : NSObject- (void)onUpdate;@end@interface ProtocolTestChildClass : ProtocolTest@en
2013-01-31 14:34:38
1020
原创 About @selector
A selector is the name used to select a method to execute for an object, or the unique identifier that replaces the name when the source code is compiled. A selector by itself doesn’t do anything. It
2013-01-31 14:24:47
509
原创 iCloud(三)保存Core Data数据到iCloud
iCloud综述及背景:请参照 iCloud(一)综述和iCloud(二)保存key value数据到iCloud。什么时候该用Key-Value来存储?You can set up Core Data to store its data on iCloud. If your app doesn’t have the concept of documents or files
2013-01-29 19:02:29
2006
1
转载 MySQL Boolean Data Type
Written by maclochlainnFebruary 26th, 2010 at 2:32 amSomebody posted a quick question about the outcome of defining a table with a bool data type in PHPMyAdmin. They were subsequently surprise
2013-01-29 15:53:13
712
转载 mysql存储引擎:InnoDB和MyISAM的区别与优劣
MyISAM:这个是默认类型,它是基于传统的ISAM类型,ISAM是Indexed Sequential Access Method (有索引的顺序访问方法) 的缩写,它是存储记录和文件的标准方法.与其他存储引擎比较,MyISAM具有检查和修复表格的大多数工具. MyISAM表格可以被压缩,而且它们支持全文搜索.它们不是事务安全的,而且也不支持外键。如果事物回滚将造成不完全回滚,不具有原子性。
2013-01-29 15:51:42
335
转载 Xcode快捷键
Command-Option-Up: 切换.h和.mCommand-Shift-D: 快速打开文件Control-2: 快速浏览当前文件成员Alt-Command-Left/Right: 前一个/后一个编辑位置Command-Shift-E: 最大化文件编辑区域Control-/: 切换到下一个占位符(自动完成的时候)Control-.: 下一个自动完成提示Comman
2013-01-29 13:38:08
493
转载 SVN: Revert to a previous revision after a wrong update
Let’s say for example you accidentally ran “svn update” and your working copy got the updates that it shouldn’t have — unfinished patches, etc.What you should do is check the logs using:svn log |
2013-01-29 13:37:16
430
转载 网页游戏入门教程
作者:北里闻箫一、简单的程序框架。webgame程序构成:三大部分。第一是数据流程。第二是程序。第三是美术。其中,数据流程包括了功能。也只有在功能中才能体现数据流程。数据流程相当的麻烦,后面再讨论。比如最简单的卖买产品。要实现这个功能。那么需要有产品基础表、产品详细表、商店表、背包表。如果扩展性更强,相应的双表是少不不了的。表的问题都简单了。关键是这
2013-01-29 13:35:17
893
转载 How To Show Line Numbers In vi / vim Text Editor
Q. How do I display vi / vim text editor line numbers while writing a shell script or c program? How can I turn on or off this feature?A. Displaying line numbers under vi / vim can be very useful
2013-01-29 13:31:33
1282
Apress.Pro.Smartphone.Cross.Platform.Development.Sep.2010
2011-10-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人