UIViewアニメーションについて
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.6f];//アニメーションさせる時間
アニメーションさせたいUIViewの結果を記入します。
[UIView commitAnimations];
以上、このままですね〜。このままでOKです。ただし、
日付の取得を紹介していきたいと思います。
NSDate *date = [NSDate date]; // 現日時を生成
NSDateFormatter *dateForm = [[NSDateFormatter alloc] init]; // 生成と初期化
[dateForm setDateStyle: NSDateFormatterLongStyle]; // 日付のスタイルを設定
[dateForm setTimeStyle: NSDateFormatterLongStyle]; // 時刻のスタイルを設定
labelDate.text = [dateForm stringFromDate: date]; // 代入
[dateForm release];
スタイルを設定するぐらいでしょうか。
ほかにも下記に記述したように、日付と時刻を別々に取得する事も可能です。
配列(NSMutableArray)に連続する番号の画像を
For文を使用して格納しようと思います。
NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
for ( int i = 1 ; i <= 24 ; i++ )
{
NSString *str = [NSString stringWithFormat:@”array_%d.png”, i ];
UIImage *img = [UIImage imageNamed: str ];
if (img)[mutableArray addObject:img];
}
*i <= 24 は連続する番号の画像が24枚だった場合なのでその都度調整します。