2014年4月27日日曜日

AdMobで「Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADSlot state]: unrecognized selector sent to instance 0x1701dbc60'」という様なエラーが出る。

AdMob導入時に「Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADSlot state]: unrecognized selector sent to instance 0x1701dbc60'」という様なエラーが出る場合、「Build Settings」の設定が足りない場合がある。

「Build Settings」の「Linking」の「Other Linker Flags」に「-ObjC」を設定すると解決する。


UITableViewのヘッダの背景色を変更する。

UITableViewを利用するとき、Viewを作るのは面倒だけど、背景色を変えたいという時が有ると思います。

そんな時はこのコード。


#pragma mark -
#pragma mark UITableViewDelegate method
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
    if(section == 0)
    {
        [view setTintColor:[UIColor orangeColor]];
    }
    else if(section == 1)
    {
        [view setTintColor:[UIColor greenColor]];
    }
}

サンプルとはいえ、色合いが。。。

2014年4月25日金曜日

【続報】アプリのアップロード時に「improper advertising identifier [IDFA] usage. your app contains the advertising identifier [IDFA] api but you have not indicated its usage on the prepare for upload page in itunes connect」というメッセージが出る

http://startup-objc.blogspot.com/2014/04/improper-advertising-identifier-idfa.html

以前の記事の続報です。

実はitunesconnectのアップ時の質問に以下の文章があります。

Advertising Identifier Does this app use the Advertising Identifier (IDFA)? The Advertising Identifier (IDFA) is a unique ID for each iOS device and is the only way to offer targeted ads. Users can choose to limit ad targeting on their iOS device.

これをNOと答えると、IDFA使ってませんと解釈されるので注意。

結果、利用したアプリはアップ時に弾かれます。

おまけに、アップしてもいないので、手動リジェクトが出来ません。

ぐぬる。

UINavigationControllerで自動表示される「前画面に戻る」的なボタンを非表示にする。

UINavigationControllerを利用していると(いえ、どんな場面でもあり得ますが)、時々前の画面に戻ってほしくない時があります。

表示が主なアプリなら良いのですが、「編集処理をしている途中に戻られると厄介」なんて事もあります。

そんな時に邪魔な「UINavigationControllerの戻るボタンを消す」のが以下のコード


 [[self navigationItem] setHidesBackButton:YES];


これでok


2014年4月10日木曜日

アプリのアップロード時に「improper advertising identifier [IDFA] usage. your app contains the advertising identifier [IDFA] api but you have not indicated its usage on the prepare for upload page in itunes connect」というメッセージが出る

アプリのアップロード時に以下のメッセージが表示される。

improper advertising identifier [IDFA] usage.
your app contains the advertising identifier [IDFA] api but you have not indicated its usage on the prepare for upload page in itunes connect
直訳
不適切な広告識別子[IDFA]使用法。 
あなたのアプリは、広告識別子[IDFA] APIが含まれていますが、あなたは接続iTunesのアップロードページの準備にその使用法を示していない。
itunes connetで毎回質問される英文の内容をよく読まないでチェックつけてサブミットしたせいかと思うけど、一回アップして手動リジェクトしないと確認出来ないので、よくわからない。
(そもそもアップが出来ないので・・・)

対応としては、AdSupportのフレームワークを外すと通ります。

調査不十分で申し訳ないですが取り急ぎ。


追記(2014-04-28)

続報です。
http://startup-objc.blogspot.jp/2014/04/improper-advertising-identifier-idfa_25.html