I'm using a TabBar View with its controller.
in .h: @interface TabsViewController : UITabBarController
in .m:
#import "TabsViewController.h"
@interface TabsViewController () < UITabBarDelegate, UITabBarControllerDelegate >
@end
@implementation TabsViewController
- (void)viewDidLoad {
TabsViewController.setSelectedIndex:1;
}
But last row give this error:
"Property 'setSelectedIndex' not found on object of type 'TabsViewController'"
Why? Thank you!
You are accessing selectedIndex property in wrong way.. I thinks you have created your own way to doing things in Objective-c. SelectedIndex in an instance Variable so you require same for setting/getting it.
Rewrite your viewDidLoad
as follows...
- (void)viewDidLoad
{
self.selectedIndex = 1; // or [self setSelectedIndex:1]
}