akkun_choi pedia
mindiaakkun_choi pedia見出し語

iPhoneアプリ開発

akkun_choi · 2010-06-14 更新

登録について

http://developer.apple.com/jp/programs/iphone/includes/compare.html#compare

スクリーンサイズの取得

UIScreen* screen = [UIScreen mainScreen];
CGSize size = screen.bounds.size;

アニメーション終了後に処理する

http://forums.pragprog.com/forums/57/topics/2182

-(void) doSomeAnimationForDuration:(float) seconds {

NSNumber *duration = [NSNumber numberWithFloat:seconds * 0.5f];
[UIView beginAnimations:@"foo" context:duration];
[UIView setAnimationDuration:seconds/2.0f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(someAnimationDidStop:finished:context:)];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
// change some property values here  
[UIView commitAnimations];
}

// delegate
-(void) someAnimationDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)duration {
  // end actions
}

めんど…。

マルチタッチを有効にする

これやらないと[touches count]が2以上にならない

view.multipleTouchEnabled = true;

参考本

iPhoneSafariで動かすWebサイトの作り方と、iPhoneネイティブアプリの作り方が半々。幅広い。とりあえず一冊でいいならこれ。

かなりハック的な感じ。やりたかったことが載ってたので買ってよかった

今のところ一番役に立ってる。全編Interface Builderを排除した解説になっている。
IB使わないコーディングはブラックボックスにならないので理解しやすい。

関連する見出し語