Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kselbee

macrumors newbie
Original poster
Apr 1, 2008
5
0
I created a Cocoa Touch Tab Bar application and put some code in the tabBarController:didSelectViewController: function but it doesn't appear to get called when I switch views. Does anyone know if this is a bug or if there's something particular I need to do? Thanks...
 

tacoman667

macrumors regular
Mar 27, 2008
143
0
I ran into that exact same issue. Are you sure from teh documentation that you wrote the correct method statement? Example, -(returnVal)methodName:<etc...>. If you do not use exactly the one the framework is looking for, it will not work.

Also make sure not to prototype that method in the <.h> interface declaration, only in the <.m> implimentation declaration. If you did this and there is a warning or error at compile-time, then you will need to add the delegate into the interface declaration. For example, @interface MyClass <TabBarControllerDelegate> {}. The reason you do this is to expose all the methods that class allows to the subclass without having to actually inherit from it. This is a new Objective-C 2.0 thing I believe.
 

kselbee

macrumors newbie
Original poster
Apr 1, 2008
5
0
Thanks for the reply. Yes, I'm sure it's right because I created a new Tab Bar application and the function is created for me... there's just no code in it. I'm guessing maybe it's a bug. Anyone know for sure?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.