私はiPhone用の開発者が使用するライブラリを作成しています(OpenFeintの実装方法と同様)。コードでインスタンス化できるように、関連するXIBを使用してViewControllerを作成しようとしています。
SplashScreenViewController *splashScreenViewController = [[SplashScreenViewController alloc] init];
UIWindow *topApplicationWindow = [self getTopWindow];
[topApplicationWindow addSubview:splashScreenViewController.view];
ただし、これは単純なコントロール(UIButtonなど)では機能しますが、SplashScreenViewControllerには何も表示されません。SplashScreenViewControllerは非常に単純です。
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface SplashScreenView : UIViewController {
}
@end
実装は空です。私のViewXIB(SplashScreenView.xib)では、ファイルの所有者のクラスをSplashScreenViewControllerに設定しようとしましたが、機能しませんでした。次に、OpenFeintで見たように、IBにViewControllerを追加してみました。メインUIViewをその子にし、代わりにクラスSplashScreenViewControllerにします。それも機能しません(表示されません)。
誰かが私が欠けているかもしれないものについて良い考えを持っているかどうか、または誰かが私が試みている方法で新しいViewControllerを作成するためのウォークスルーを推奨できるかどうか疑問に思っています。
ありがとう!