2012-02-06 1 views
0

уже несколько часов пытаются сделать мое приложение iphone универсальным. Миссия прошла успешно, но странная проблема. Контроллер навигации продолжает толкать вещи, даже не нажимая ничего. Приложение не врезаться, но это дает мне сообщение в консолиПопытка сделать мое приложение iphone универсальным. Контроллер навигации продолжает говорить, что неуравновешенные звонки

nested push animation can result in corrupted navigation bar 2012-02-06 10:52:07.701 @#$%^^$[54755:207] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. 2012-02-06 10:52:07.704 [email protected]#$%^$%#[54755:207] Unbalanced calls to begin/end appearance transitions for <searchEditViewController: 0xc652150>.

и вот как я настроил приложение все это:

[экран навигации выстрел] [1]

вот мой код в AppDelegate_iphone.h

#import <UIKit/UIKit.h> 
#import "iPhoneView.h" 
#import "AboutUsViewController.h" 
#import "FavoritesViewController.h" 

@class iPhoneView; 

@interface AppDelegate_iPhone : NSObject <UIApplicationDelegate> { 

    UITabBarController *tabBarController; 
    UINavigationController *homeNavigationController; 
    UINavigationController *favouritesNavigationController; 
    AboutUsViewController *aboutUsViewController; 

    iPhoneView * search; 
    FavoritesViewController *favoritesViewController; 
    UIWindow *window; 
} 
@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet iPhoneView *search; 
@property (nonatomic, retain) FavoritesViewController *favoritesViewController; 

@end 

и вот на мой файл AppDelegate.m

#import "AppDelegate_iPhone.h" 
#import "iPhoneView.h" 

@implementation AppDelegate_iPhone 

@synthesize window,search,favoritesViewController; 


#pragma mark - 
#pragma mark Application lifecycle 

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{ tabBarController = [[UITabBarController alloc] init]; 

    homeNavigationController = [[UINavigationController alloc] init]; 

    search = [[iPhoneView alloc] init]; 
    [homeNavigationController pushViewController:search animated:NO]; 

    favouritesNavigationController = [[UINavigationController alloc] init]; 
    favoritesViewController = [[FavoritesViewController alloc]init]; 
    [favouritesNavigationController pushViewController:favoritesViewController animated:NO]; 

    aboutUsViewController =[[AboutUsViewController alloc] init]; 

    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"επικοινωνία" image:[UIImage imageNamed:@"aboutus"] tag:0]; 
    aboutUsViewController.tabBarItem = item; 
    [item release]; 

    UITabBarItem *item2 = [[UITabBarItem alloc] initWithTitle:@"αγαπημένα" image:[UIImage imageNamed:@"favorites"] tag:0]; 
    favouritesNavigationController.tabBarItem = item2; 
    [item2 release]; 

    NSArray *tabBarControllerCollection = [NSArray arrayWithObjects:homeNavigationController,favouritesNavigationController,aboutUsViewController,nil]; 
    [tabBarController setViewControllers:tabBarControllerCollection animated:NO]; 

    [window addSubview:tabBarController.view]; 
    [window makeKeyAndVisible]; 
} 


- (void)applicationWillResignActive:(UIApplication *)application { 
    /* 
    Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 
    Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 
    */ 
} 


- (void)applicationDidEnterBackground:(UIApplication *)application { 
    /* 
    Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 
    */ 
} 


- (void)applicationWillEnterForeground:(UIApplication *)application { 
    /* 
    Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. 
    */ 
} 


- (void)applicationDidBecomeActive:(UIApplication *)application { 
    /* 
    Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 
    */ 
} 


- (void)applicationWillTerminate:(UIApplication *)application { 
    /* 
    Called when the application is about to terminate. 
    See also applicationDidEnterBackground:. 
    */ 
} 


#pragma mark - 
#pragma mark Memory management 

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 
    /* 
    Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 
    */ 
} 


- (void)dealloc { 
    [tabBarController release]; 
    [search release]; 
    [favoritesViewController release]; 
    [favouritesNavigationController release]; 
    [aboutUsViewController release]; 
    [window release]; 
    [super dealloc]; 
} 


@end 

ответ

1

ОК решил подключить кнопку 2 раза с тем же действием в IB. Принял меня 48 часов, чтобы понять это!

Смежные вопросы