akkun_choi pedia
mindia › akkun_choi pedia › 単語

iPhoneアプリ開発

akkun_choi · 2010-06-14 更新 · 履歴(10)
第 6 版(2010-06-08 19:29:39 · akkun_choi)を表示しています。 最新版に戻る

登録について

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];
}
-(void) someAnimationDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)duration {

NSNumber *seconds = (NSNumber *)duration;  // removing the cast d/n work either . . . 

// why can't I pull the float value out?
float f = [seconds floatValue]; // this is where we crash . . . 

[UIView beginAnimations:@"foo2" context:nil];
[UIView setAnimationDuration: [seconds floatValue]];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(glowOffAnimationDidStop)];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//change another set of properties here
[UIView commitAnimations];
}

めんど…。

参考本

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

まだあんまり読んでない。詳しそう。

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

履歴

タグ

「iPhoneアプリ開発」タグが付けられた単語