2014-03-01から1ヶ月間の記事一覧
UITableViewController の refreshControl っていうプロパティにセットするだけ!簡単すぎてビックリ!以前は大変だったみたいだけど、iOS6 から簡単になったみたいですね〜 - (void)viewDidLoad { [super viewDidLoad]; self.refreshControl = [[UIRefreshC…
scrollToRowAtIndexPath:atScrollPosition:animated: メソッドで任意のセルの場所までスクロールできる。 int section = [self.tableView numberOfSections] - 1; int row = [self.tableView numberOfRowsInSection:section] - 1; NSIndexPath *indexPath = …
コントローラで UIView を addSubview したりするじゃないですか。この UIView をあとから利用したい場合にどうやって取ってきたら良いのかという話。タグを使って #define LABEL_TAG 1 - (void)viewDidLoad { [super viewDidLoad]; UILabel *label = [[UILa…
初期化にはいろいろな方法がある。 1. UILabel などを、サイズや位置を指定しつつ生成するとき initWithFrame: 2. Storyboard から UIView を生成するとき initWithCoder: 3. xibファイルをコード上から読み込みたいとき initWithNibName:bundle: Storyboard…
// Command + 1 ~ 6 ナビゲーションバーの中のタブの移動 // Command + Shift + F プロジェクト全体からの検索 // Ctrl + 6 ファイル内のメソッド検索(絞り込みも可) // Cmd + Shift + J 現在開いているファイルにフォーカス
// imageView がタップされたときに tapImageView という処理を行う UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapImageView)]; [self.imageView addGestureRecognizer:tapGes…
画面上の方にぴょこっと現れるアレ。アプリ開いてると出ないみたい。 UILocalNotification *localNotification = [[UILocalNotification alloc] init]; NSDate *fireDate = [[NSDate alloc] initWithTimeInterval:10*60 sinceDate:[NSDate date]]; // 10分後…
ターミナルで一発でいけた!! defaults write com.apple.dt.Xcode AppleLocale en_US