I am trying a tutorial for using story board from ray. I am using a tab bar controller connecting a tableview embedded with navigation controller, and this table view is named as players and a view controller connecting tab bar controller named as gestures. Displaying players game, name and rating in players tableview by storing those details in an object. So i have created a new file player with base object to store them as properties now i have to store those properties in an array of the view controller called player view controller and then i have to make the array and some test Player objects in the App Delegate and then assign it to the PlayersViewController’s players property using an instance variable.so In AppDelegate.m, i imported player and player view controller.h headers and add a new instance variable named _players. so my code in app delegate.m is as below the error is subscript requires size of interface 'NSARRAY' which is not constant in non-fragile ABI at the line viewcontrollers[0].
#import "AppDelegate.h"
#import "Player view controller.h"
#import "player.h"
@implementation AppDelegate {
NSMutableArray *_players; }
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
_players=[NSMutableArray arrayWithCapacity:20];
player *player1=[[player alloc]init];
player1.name=@"name";
player1.game=@"cricket";
player1.rating=3;
[_players addObject:player1];
player1=[[player alloc]init];
player1.name=@"name";
player1.game=@"football";
player1.rating=3.5;
[_players addObject:player1];
player1=[[player alloc]init];
player1.name=@"tony";
player1.game=@"handball";
player1.rating=4;
[_players addObject:player1];
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UINavigationController *navigationController = [tabBarController viewControllers][0];
UINavigationController *navigationController = [tabBarController viewControllers][0]; /*at this point i get a error as [error: subscript requires size of interface 'NS ARRAY' which is not constant in non-fragile ABI] */
Player view controller *playersViewController = [navigationController viewControllers][0];
playersViewController.players = _players;
return YES;