なんとなく

忘備録です

X-Codeの入力補完、カラー表示がされない時のメモ

昨日から、急にX-codeの調子がおかしくなった…orz

Jump-To-Definition も出来ないので、どうしたものか?
と思ったら、同じような事、あるのね。当然か。

☆入力補完できない・色分けされない
http://d.hatena.ne.jp/foxsal/20111213/1323741504

サンクスです!

UITableView のセルIndexで選択OK or NG を設定するメモ

テーブルの先頭セルだけ選択したくない、次のセル移行は選択させたい という時。

テーブルセルのデータ設定処理で、indexPath毎に処理を変える。(実際は、tag毎かな?)

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell;
    if (indexPath.row == 0)
    {
         [self createNoSeletionCell : cell];
    }
    else
    {
        [self createSeletionCell : cell];
    }
    return cell;
}

テーブル選択させたくないセルには、選択色無しに。

- (void) createNoSeletionCell :(UITableViewCell *)cell
{
    // 何か処理
     :
    // 選択色無し設定
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

}

テーブル選択OK のセルには、通常通りの設定。今回は、選択色をグレーに。

- (void) createSeletionCell :(UITableViewCell *)cell
{
    UITableViewCell *cell = …
     :
    // 選択色をグレー設定
    cell.selectionStyle = UITableViewCellSelectionStyleGray;

}

なんてこと無いね。

もちろん テーブル選択した時の処理で、Index(or Tag) で判定して処理を実装!
こないだ 作った気がするのに、すーぐ忘れる…orz

info.plist の追加方法&アイコンデフォルトの光沢を消すメモ

デフォルト設定のアイコンの光沢を消す時って、info.plistを編集する…とよく書いてあるけど、
よく分からなかった、というか、やったことなかったので、メモ。

【環境】
・X-Code 4.3.3
・iOS5,1 シミュレータ

1) X-Code のプロジェクト名を選択→"TARGETS"のAPP名を選択
2) Info → Custom iOS Target Properties / Key → Icon files (iOS 5) を選択
3) >Primary Icon を開き、Icon files を選択。+マークを選択する。(1行追加される。)
4) 表示された追加Key で、"Icon already includes gloss effect" を選択。
5) Type → Boolean に変更し、"YES" を選択。

以上。

ちなみに、iconのイメージを設定しとかないと、↑ "Icon files" のキーは表示されないので注意!


【参考サイト】
☆アプリケーションアイコンの光沢を消すには
http://iphone0app.blog45.fc2.com/blog-entry-13.html
☆iOS5でアプリケーションアイコンの光沢を消す
http://www.hirano-dept.com/blog/2011/10/ios5.html

UINavigationController の pushViewController で回転しながら遷移させるメモ

画面遷移するのは、UIView.addSubView とか、色々ありますが、階層遷移で、
回転させようと思ったら、自分で animation を設定させないといけない。
<画面遷移の回転なんだから、NavigationController でやってくれたら良いのに なんて…(^^;

presentModalViewController での

nextViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navigationController animated:YES];

Horizontal でのスタイルを、UINavigationController.pushViewController 遷移で
実行したい という事。


Animationは、UIView を使って。

通常の Navigation 遷移は、

// 次画面遷移
- (void) transitNextView
{
    // 次画面定義
    NextViewController *nextViewController = [[NextViewController alloc] init];
    // 次画面遷移
    [self.navigationController pushViewController:nextViewController animated:NO];
}

このpushViewでの遷移を、UIViewのAnimationを使って実行する

// 次画面遷移
- (void) transitNextView
{
    // 次画面定義
    NextViewController *nextViewController = [[NextViewController alloc] init];
    
    // Animation定義開始
    [UIView  beginAnimations:nil context:NULL];
    // Animationの速度設定:徐々に加速
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    // Animation実行時間:0.75秒
    [UIView setAnimationDuration:0.75];
    // 次画面遷移
    [self.navigationController pushViewController:nextViewController animated:NO];
    
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
    // Animation開始
    [UIView commitAnimations];
}

いろんなサイト巡って、色々試して何日もかかった割に、ほぼパクリんちょで作りました…orz
これから さ!

【参考】
iOS transition animation for pushViewController
http://stackoverflow.com/questions/10820294/ios-transition-animation-for-pushviewcontroller
☆トランジション[1] UIViewを使ったもの
http://cocoadays.blogspot.jp/2010/09/uiview-1.html
☆UIView Class Reference
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html

ログインID&パスワード用のキーボード設定メモ

UITextField で、カーソルが当たった時に表示されるキーボードの
各種表示を変えるのは、勿論、設定を変えるだけ。
Return → GO は、

self.passTextField.returnKeyType = UIReturnKeyGo;

とかね。

☆UITextField/UITextViewの文字入力で覚えておくと便利なこと
http://www.toyship.org/archives/82


で、ハマったのは、ユーザーID or パスワード入力なんだから、
デフォルトが日本語キーボードの場合、前回表示したキーボード表示が
反映されてしまうこと…orz

self.passTextField.keyboardType = UIKeyboardTypeASCIICapable;

↑コレだと、確かに、英数入力キーボードになるけど、文字種選択ボタン(地球儀マークの)で
日本語入力も選択できるし、前回表示が日本語キーボードだと、日本語のに…


てことで、未だハマリ中…orz

HELP!