Dev/iOS
xcode 4.2에서 window based application 만드는 방법.
깐따삐아님
2011. 11. 22. 00:49
출처 http://upthere9.egloos.com/2816138
펌: http://nsec.tistory.com/112
iOS -> Application -> Empty Application
Project -> New File -> User Interface -> Empty -> Next -> Device Family ->iPhone -> Next -> MainWindow -> Create
MainWindow.xib -> Placehoders -> File's Owner -> Identity Inspector - Custom Class -> Class -> UIApplication 입력
Object LIbrary에서 Object 를 Objects로 드래그
Objects -> Object -> Identity Inspector - Custom Class -> Class -> AppDelegate 입력
Object Library에서 Window를 Objects로 드래 그
AppDelegate.h를 열어
" @property (strong, nonatomic) UIWindow *window; " 를
Project -> New File -> User Interface -> Empty -> Next -> Device Family ->iPhone -> Next -> MainWindow -> Create
MainWindow.xib -> Placehoders -> File's Owner -> Identity Inspector - Custom Class -> Class -> UIApplication 입력
Object LIbrary에서 Object 를 Objects로 드래그
Objects -> Object -> Identity Inspector - Custom Class -> Class -> AppDelegate 입력
Object Library에서 Window를 Objects로 드래 그
AppDelegate.h를 열어
" @property (strong, nonatomic) UIWindow *window; " 를
" @property (strong, nonatomic) IBOutlet UIWindow *window; " 로 변경 후 저장. AppDelegate.m를 열어 아래부분을 주석 처리한다.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch.
MainWindow.xib -> Placehoders -> File's Owner -> Connection Inspector -> Outlets -> delegate 를 Objects -> AppDelegate로 연결한다.
MainWindow.xib -> Placehoders -> Objects -> App Delegate -> Connection Inspector -> Outlets -> window를 Objects -> Window로 연결한다.
Project -> Summary -> iPhone/ iPod Deployment Info -> Main Interface -> MainWindow 입력