J'ai une barre d'onglets avec 5 boutons. Sur 5 onglets, 2 sont des vues de table qui utilisent le contrôleur de navigation pour afficher les vues secondaires sur le clic de la cellule. Au-dessus de la barre d'onglets, dans chaque vue, j'ai laissé de la place pour les publicités en utilisant "Admob". J'ajoute des publicités en utilisant IB. Mais il donne EXC_BAD_ACCESS quand il atteint "adMobAd = [AdMobView requestAdWithDelegate: self];" dans AdViewController.mAdmob dans l'iPhone avec Tabbar et TableView
J'utilise les lignes de code suivantes pour ajouter des vues à la vue de la barre d'onglets. Dans mon code, je viens d'ajouter des annonces à LatestNews seulement. Quelqu'un peut-il m'aider à sortir de ce problème.
UINavigationController *localNavigationController;
// create tab bar controller and array to hold the view controllers
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:5];
// setup the first view controller (Root view controller)
LatestNews* latestNewsController;
latestNewsController = [[LatestNews alloc] initWithTabBar];
// create the nav controller and add the root view controller as its first view
localNavigationController = [[UINavigationController alloc] initWithRootViewController:latestNewsController];
// add the new nav controller (with the root view controller inside it)
// to the array of controllers
[localControllersArray addObject:localNavigationController];
// release since we are done with this for now
[localNavigationController release];
[latestNewsController release];
// setup the second view controller just like the first
Forums* forumsController;
forumsController = [[Forums alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController:forumsController];
[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[forumsController release];
RecipeList* recipesController = [[RecipeList alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController:recipesController];
[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[recipesController release];
//Setup Connect view
Connect* cnt = [[Connect alloc] initWithTabBar];
[localControllersArray addObject:cnt];
[cnt release];
//Setup Subscribe View
Subscribe* scribe = [[Subscribe alloc] initWithTabBar];
[localControllersArray addObject:scribe];
[scribe release];
// load up our tab bar controller with the view controllers
tabBarController.viewControllers = localControllersArray;
[localControllersArray release];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
Vous indiquez que votre application plante lorsque vous accédez à AdMobView, mais aucun des codes ci-dessus ne montre comment configurer cette vue. Sans cela, nous ne pouvons pas vous donner de conseils spécifiques. –