July 2011
2 posts
3 tags
Unit Testing in Xcode 4 Quick Start Guide | Ray... →
Unit Testing in Xcode 4 Quick Start Guide
Xcode4での単体テストチュートリアル。デフォルトのOCUnitではなくGHUnit+OCMockを使用する方法が紹介されている。
2 tags
[Webサービス] Pythonプログラミングを2時間で学べる43個のチュートリアル動画。 |... →
June 2011
5 posts
2 tags
Technical Q&A QA1673: Technical Q&A QA1673 →
How to pause the animation of a layer tree
アニメーションを一時停止する方法
UserVoice - Customer Feedback and Helpdesk... →
iPhoneアプリ出したらこういうのでFeedbackをもらえばいいかも。
iphone - Can you make the settings in... →
iCloud の意味するもの « maclalala2 →
2 tags
アプリのメモリ使用量をリアルタイムに表示するクラスを公開しました - Over&Out その後 →
Instrumentsを使うほどではないけどざっくりメモリ使用量を確認したい…ってときに便利かも。
May 2011
7 posts
2 tags
NSDate - 日付の計算、過去の日や末日を求める方法 - 強火で進め →
2 tags
Xcode4の自動コンパイルを無効にする
下記設定項目のチェックを外す。
1. Xcode > Preferences > General > Enable Live Issues > In Editors, In Issue Navigator
2. File > Project Settings… > Enable live issues in the source editor
2 tags
NSLogでCGRect型の情報を出力
NSLogでCGRect型の情報を出力するには、
NSLog(@”%@”,NSStringFromCGRect(frame));
とやるのが楽みたい。
2 tags
NSDictionaryの内容表示
NSLog(@”%@”, [dictionaryObj description]);
1 tag
開発環境構築(GAE等)
Google App Engine SDK
Eclipse
pydev
http://blog.glasses-factory.net/2011/03/28/GAE-py-for-Flasher—-1-Python http://blog.glasses-factory.net/2011/03/29/GAE-py-for-Flasher—-2
1 tag
開発環境構築(MacPortsの環境更新)
MacPortsの環境更新。
Python2.5とpython_selectのインストール。
http://blog.livedoor.jp/bakorer/archives/50485158.html
1 tag
開発環境構築(MacPortsインストール)
MacPortsをインストール。
http://blog.soi33.org/archives/17
April 2011
2 posts
2 tags
アクセッサ経由でnilを代入すればreleaseが1回行われる
ただし修飾子がretainの場合かつ代入前の値がnil以外の場合に限る。 もう少し正確に言うと、プロパティに対して異なるオブジェクトを代入すると、代入前のオブジェクトに対して1回releaseが行われる。releaseされる理由は、retain指定でpropertyを作成した場合にどういうセッターメソッドが作られるのかをドキュメントで確認すれば分かる。
例
@property (nonatomic, retain) NSMutableArray *array;
- (void)method {
// プロパティ経由で代入
// [array retainCount] = 1(allocの分) + 1(retainの分) = 2
self.array = [[[NSMutableArray alloc] init] autorelease];
...
} //...
String Format Specifiersの解説(フォーマット指定子の解説) - 強火で進め →
March 2011
1 post
2 tags
Xcode 4.0.1にはgit 1.7.3.4が含まれるっぽい
Xcode 4.0.1をインストールするとgit 1.7.3.4もインストールされるようだ。
February 2011
9 posts
3 tags
UIPasteboard Class Reference →
テキストのコピー、ペーストの操作にはUIPasteboardを使う。
2 tags
retain と copy の使い分け方 →
NSStringの場合は何も考えずcopyを使ってるんだけど、これを読む限りretain、copyのどちらでもよさそう。ただし、NSMutableStringの場合はcopyを使うべき。 ※追記:文字列を値として利用したいのだから、NSStringの場合もやはりcopyを使うべき。
2 tags
アプリをバックグラウンドで動作させず終了する
1. info.plistに”Application does not run in background”キーを追加(ドロップダウンで選択)
2. チェックを付ける
参照:
http://bit.ly/gjo1Av (UIApplicationExitsOnSuspend の記述)
2 tags
OBSlider, a UISlider subclass with variable... →
UISliderの微調整をやりやすくするクラス。
MITライセンス。
2 tags
In App Purchase Programming Guide: Introduction →
2 tags
UIPopoverControllerのTutorial →
2 tags
14 Essential Xcode Tips, Tricks and Resources for... →
XcodeのTips集。
2 tags
Xcode用オリジナルテンプレートの作成
1. 下記ディレクトリ配下にある既存のテンプレート(ディレクトリ)をコピーする。
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/Application
2. コピーしたテンプレートを以下のディレクトリにペーストする。
~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Application/
3. するとこうなる。
4. テンプレートの内容をカスタマイズする。
2 tags
MainWindow.xibを削除してwindowを自前で作成
自前でwindowオブジェクトを作成する手順。
1. MainWindow.xibを削除
2. info.plistから”Main nib file base name”キーを削除
3. main.mを修正
// UIApplicationMain第四引数にAppDelegateを指定
int retVal = UIApplicationMain(argc, argv, nil, @"XXXAppDelegate")
4. XXXAppDelegate.mにwindow作成処理を追加
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CGRect frameForWindow =...
January 2011
1 post
2 tags
URLエンコーディング
URLエンコーディングのサンプル
NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)unencodedString,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
Please refer to: http://simonwoodside.com/weblog/2009/4/22/how_to_really_url_encode