2016-07-28 99 views
0

嗨,我已經按照此github頁面添加MFSideMenu並顯示以下錯誤。MFSideMenu不適用於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) 

這是我的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你h和.M目標正確添加或不 –

+0

我編譯源看起來像附截圖 – Bangalore

+0

哪裏是你mfide菜單CLAS –

回答

0

使用此代碼AppDelegate.m它在故事板爲我工作。

- (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; 
} 

也採取了新的視圖控制器在故事板並將其標記爲初始視圖控制器並且給它的類名以及故事板ID作爲MFSideMenuContainerViewController。

0

通常,當BoxView的代碼沒有正確編譯到目標中時會發生這種情況。

enter image description here

您需要確保目標你正在構建都有其對應的複選框選中您MFSideMenuContainerViewController.m實現文件。

'乾淨和構建'從來不會傷害,要麼。