It looks like when you show your Welcome screen, you push it onto a UINavigatonController
. But when you click Done, you're trying to set the root view controller on the window instead of just popping the view controller from the navigation controller. It also looks like you're creating a new instance of your FeedViewController
instead of using the instance you already have created.
Also, have you checked to see if it's even executing the code in your showDone:
method? You're using ==
to compare the tintColor
of a UIBarButtonItem
with a UIColor
, but using ==
will only return true if they're both the exact same UIColor
instance, which they might not be. You'll want to use the method isEqual:
to compare two colors, so you would do the following instead:
[self.navigationItem.rightBarButtonItem.tintColor isEqual:[UIColor redColor]]
Note that this won't always return YES
for equal colors if they're in different color spaces, but most of the time this should work.
Also, you should consider moving your code out of your app delegate, because generally application:didFinishLaunchingWithOptions:
is used only for things that need to be done immediately upon startup. It shouldn't be used to initialize a bunch of view controllers, those should only be initialized when it's time for them to be displayed.