FeedContentVC *feedVC= [[FeedContentVC alloc] initWithNibName:@"FeedContentVC" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:feedVC];
navigationController.navigationBar.barStyle = UIBarStyleBlack;
[window setRootViewController:navigationController];
Asked
Active
Viewed 60 times
1

Dharmesh Dhorajiya
- 3,976
- 9
- 30
- 39

Suraj_Singh
- 39
- 3
-
possible duplicate of [Applications are expected to have a root view controller at the end of application launch](http://stackoverflow.com/questions/7520971/applications-are-expected-to-have-a-root-view-controller-at-the-end-of-applicati) – Rumin Sep 21 '15 at 06:46
2 Answers
0
Although things looks correct in what you are doing, could you please confirm following:
window
is a strong property in yourAppDelegate
. It should be[self.window setRootViewController:navigationController]
.- Put a breakpoint and check that
feedVC
is not nil. - You have this statement in your code
[self.window makeKeyAndVisible];
.

Abhinav
- 37,684
- 43
- 191
- 309
0
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
FeedContentVC *feedVC= [[FeedContentVC alloc] initWithNibName:@"FeedContentVC" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:feedVC];
navigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.window setRootViewController:navigationController];

Idrees Ashraf
- 1,363
- 21
- 38