06 2014 档案
摘要:Cocos2d-x从2.x版本到现在的Cocos2d-x 3.0 Final版,其引擎驱动核心依旧是一个单线程的“死循环”,一旦某一帧遇到了“大活儿”,比如Size很大的纹理资源加载或网络IO或大量计算,画面将 不可避免出现卡顿以及响应迟缓的现象。从古老的Win32 GUI编程那时起,Guru们就告...
阅读全文
摘要:需要的工具:apktool:将apk文件反编译成原始的目录文件地址:http://code.google.com/p/android-apktool/downloads/listdex2jar:将dex文件转化为jar文件地址:http://code.google.com/p/dex2jar/dow...
阅读全文
摘要:1、老王辛苦了一年,年终奖拿了1万,左右一打听,办公室其他人年终奖却只有1千。老王按捺不住心中狂喜,偷偷用手机打电话给老婆:亲爱的,晚上别做饭了,年终奖发下来了,晚上咱们去你一直惦记着的那家西餐厅,好好庆祝一下!2、老王辛苦了一年,年终奖拿了1万,左右一打听,办公室其他人年终奖也是1万,心头不免掠过...
阅读全文
摘要:Swift 使用来声明泛型函数或泛型类型:1 func repeat(item: ItemType, times: Int) -> ItemType[] {2 var result = ItemType[]()3 for i in 0..times {4 result...
阅读全文
摘要:协议 Swift 使用protocol定义协议:1 protocol ExampleProtocol {2 var simpleDescription: String { get }3 mutating func adjust ()4 }类型、枚举和结构都可以实现(adopt)协议...
阅读全文
摘要:枚举 使用enum创建枚举——注意 Swift 的枚举可以关联方法: 1 enum Rank: Int { 2 case Ace = 1 case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten 3 case Jack, Q...
阅读全文
摘要:创建和使用类 Swift 使用class创建一个类,类可以包含字段和方法:1 class Shape {2 var numberOfSides = 03 func simpleDescription () -> String {4 return "A shape w...
阅读全文
摘要:函数 Swift 使用func关键字声明函数:1 func greet (name: String, day: String) -> String {2 return "Hello \(name), today is \(day)."3 }4 greet ("Bob", "Tuesday"...
阅读全文
摘要:概览 Swift 的条件语句包含if和switch,循环语句包含for-in、for、while和do-while,循环/判断条件不需要括号,但循环/判断体(body)必需括号:1 let individualScores = [75, 43, 103, 87, 12]2 var teamScor...
阅读全文
摘要:Hello, world 类似于脚本语言,下面的代码即是一个完整的 Swift 程序。1 println ("Hello, world")变量与常量 Swift 使用var声明变量,let声明常量。1 var myVariable = 422 myVariable = 503 let myCon...
阅读全文
摘要:Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility.Swi...
阅读全文