0

我正在努力让这个PaperFoldMenuController 运行,虽然它工作正常,但在设置foldMenuViewController.delegate = selfI am时出现错误Assigning to 'id<PaperFoldMenuControllerDelegate>' from incompatible type 'DOAppDelgate *const__strong'。我将它分配在与似乎运行良好的演示完全相同的位置。有任何想法吗?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
  [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

  UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
  DOMasterViewController *controller = (DOMasterViewController *)navigationController.topViewController;
  controller.managedObjectContext = [self managedObjectContext];

  foldMenuViewController = [[DOMenuViewController alloc] initWithMenuWidth:200 numberOfFolds:5];
  foldMenuViewController.delegate = self;
  [self.window setRootViewController:foldMenuViewController];

  NSMutableArray* viewControllers = [NSMutableArray array];
  [viewControllers addObject:navigationController];
  [viewControllers addObject:controller];

  [foldMenuViewController setViewControllers:viewControllers];

  return YES;
}
4

1 回答 1

1

你可能需要你的类来实现协议:PaperFoldMenuControllerDelegate

@interface DOAppDelgate()<PaperFoldMenuControllerDelegate>
- (BOOL)paperFoldMenuController:(PaperFoldMenuController *)paperFoldMenuController shouldSelectViewController:(UIViewController *)viewController;
- (BOOL)paperFoldMenuController:(PaperFoldMenuController *)paperFoldMenuController shouldFoldMenuToRevealViewController:(UIViewController *)viewController;
- (void)paperFoldMenuController:(PaperFoldMenuController *)paperFoldMenuController didSelectViewController:(UIViewController *)viewController;
@end

...然后实现这些方法。

编辑:将实现更改为接口,mybad。

于 2013-02-03T02:22:11.493 回答