2016-07-28 10 views
0

Hallo, ich habe diese Github-Seite verfolgt, um MFSideMenu hinzuzufügen und seinen folgenden Fehler anzuzeigen.MFSideMenu funktioniert nicht in iOS?

Undefined symbols for architecture x86_64: 
    "_OBJC_CLASS_$_MFSideMenuContainerViewController", referenced from: 
     objc-class-ref in AppDelegate.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Das ist mein AppDelegate

- (ViewController *)demoController { 
    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil]; 
    ViewController *main = (ViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"home"]; 

    return main; 
} 

- (UINavigationController *)navigationController { 
    return [[UINavigationController alloc] 
      initWithRootViewController:[self demoController]]; 
} 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    // Override point for customization after application launch. 
    leftMenuController *leftMenuViewController = [[leftMenuController alloc] init]; 

    MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController 
                containerWithCenterViewController:[self navigationController] 
                leftMenuViewController:leftMenuViewController 
                rightMenuViewController:nil]; 
    self.window.rootViewController = container; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 

enter image description here

+0

chcek Ihre .h und .m sind im Ziel oder nicht –

+0

meine Kompilierung Quelle sieht aus wie das angebracht Screenshots – Bangalore

+0

korrekt hinzugefügt, wo –

Antwort

0

Verwenden Sie diesen Code in AppDelegate.m es für mich in Storyboard funktioniert.

- (ViewController *)demoController { 
    return [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 
} 

- (UINavigationController *)navigationController { 
    return [[UINavigationController alloc] 
      initWithRootViewController:[self demoController]]; 
} 


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; 
    MFSideMenuContainerViewController *container = (MFSideMenuContainerViewController *)self.window.rootViewController; 
    UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"navigationController"]; 
    UIViewController *leftSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:@"leftSideMenuViewController"]; 
    UIStoryboard *storyboard1 = [UIStoryboard storyboardWithName:@"second" bundle:[NSBundle mainBundle]]; 
    UIViewController *left = [storyboard1 instantiateViewControllerWithIdentifier:@"rightSideMenuViewController"]; 

    [container setLeftMenuViewController:leftSideMenuViewController]; 
    [container setLeftMenuViewController:left]; 
    [container setCenterViewController:navigationController]; 

    // Override point for customization after application launch. 
    return YES; 
} 

nehmen auch einen neuen View-Controller in Storyboard und es als Ausgangs-View-Controller markieren und sowie Storyboard-ID als MFSideMenuContainerViewController seine Klassennamen geben.

0

Im Allgemeinen wird dies auftreten, wenn der Code für BoxView nicht korrekt in Ihr Ziel kompiliert wird.

enter image description here

Sie müssen sicherstellen, dass die Ziel Sie bauen ihre entsprechenden Box für Ihre Datei MFSideMenuContainerViewController.m Implementierung geprüft hat.

Ein 'Clean and Build' tut auch nie weh.

Verwandte Themen