XCode4TemplateForXCode5
Water
|
01/28/2014
|

In Xcode 5, the default project template will create a new project using storyboard and use new API for iOS 7 only.

This repo ported older project under Xcode 4 to Xcode 5, so that you can easily create project that supports both iOS 6 and iOS 7. It is useful if you want to:

  1. Using xib instead of storyboard.
  2. Support both iOS 6 and iOS 7.

Installation

Copy "XC4 Installation" folder in this repo t

Continue Reading

Suppress ".. is deprecated" warning in code block
Water
|
01/28/2014
|
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (void) methodUsingDeprecatedStuff {
    //use deprecated stuff
}
#pragma clang diagnostic pop
drawInRect:withAttributes: in iOS 7 and iOS 6.1
Water
|
01/20/2014
|

iOS 7 comes with a new method in NSString for drawing text:

drawInRect:withAttributes:

However if you try to test and use the API using:

if ([string respondsToSelector: @selector(drawInRect:withAttributes:)])

You thing it should work, but actually it will crash on iOS 6.1. It is because the method was already existed in iOS 6.1 as hidden API. And it seems the parameters are different and so th

Continue Reading

Moto G vs 紅米
Water
|
01/15/2014
|

今天終於有 Moto G 行版消息,以下是兩部平價 Android 機比較:

型號 紅米 Moto G
價錢 $999 $1898
OS 4.2 MIUI 4.3 (可升級 4.4)
呎吋 137 x 69 x 9.9 mm 129.9 x 65.9 x 11.6 mm
重量 158g 143 g
CPU Mediatek MT6589T Quad-core 1.5 GHz Qualcomm Snapdragon 400 1.2GHz quad-core
GPU PowerVR SGX544 Adreno 305
Quadrant Benchmark 4748 8082
RAM 1GB 1GB
ROM 4GB 16GB
存儲擴展 有 (最大32GB) 沒有
藍牙 3.0HS 4.0
LTE 沒有 沒有
SIM SIM Micro

Continue Reading

iOS 沒有 GB18030?
Water
|
01/15/2014
|

最近台灣 JustFont 有一篇文是關於 GB 18030 就在你身邊 講到台灣很多地方已經用了 GB18030 這種大陸字體。

有人說 Android 出賣港台用 GB18030,而 iOS, Windows Phone 則沒有採用 GB18030。其實根據大陸法例,所有軟硬體的字型庫都要經信標委檢查。你覺得 iPhone 沒有用 GB18030 可以在大陸賣嗎?

為什麼我們會看到 Android 出 GB18030 字體而 iOS 卻沒有問題?主要是因為,Android 系統入面,只有一千零一個中文字體叫 Droid Sans Fallback,裡面就已經包括了中日韓和其他非英文的字體,而很不幸地當中漢字是跟中國大陸的字型。究其原因可能是因為全世界只有中國才要人拿 fonts 去送檢的,而因為 Android 系統設計只有一套中文字體,便只好用大陸那套了。

至於 iOS,裡面有

Continue Reading