1

多くの開発者のように、私はIOS5の新機能をいじっています。

アプリをカスタマイズするために外観プロキシを使用しようとしました。しかし、いくつかの方法でエラーが発生します。

これは機能します:

[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
//and
[[UINavigationBar appearance] setTintColor:[UIColor greenColor]];

しかし、私が試してみると:

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"toolbar_background.png"]];

認識できないセレクターエラーが発生します:

-[_UIAppearance setBackgroundImage:]: unrecognized selector sent to instance 0x153020
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAppearance setBackgroundImage:]: unrecognized selector sent to instance 0x153020'
*** First throw call stack:
(0x3107a8bf 0x3821f1e5 0x3107dacb 0x3107c945 0x30fd7680 0x2fe7 0x3304c7eb 0x330463bd 0x33014921 0x330143bf 0x33013d2d 0x33bffe13 0x3104e553 0x3104e4f5 0x3104d343 0x30fd04dd 0x30fd03a5 0x33045457 0x33042743 0x2f31 0x2ec8)
terminate called throwing an exception(gdb) 

何か案は ?

4

1 に答える 1

1

メソッドの名前が異なります。その一部が欠落しています。iOS 5はまだNDAの下にあるので、ここでメソッド名を引用したりリンクしたりすることはしませんが、自分で調べることができます。

  • iOSDevCenterに移動します。
  • iOS SDKGMSeedを選択します。
  • iOS開発者ライブラリを選択します。
  • 検索フィールドに、UINavigationBarと入力し始めます。
  • UINavigationBarクラスリファレンスリンクをクリックします。
  • ドキュメントを読んでください。
于 2011-10-09T09:56:31.657 に答える