0

I am working on getting this PaperFoldMenuController going and though it is working fine, I am getting an error when setting foldMenuViewController.delegate = self that I am Assigning to 'id<PaperFoldMenuControllerDelegate>' from incompatible type 'DOAppDelgate *const__strong'. I am assigning it in exactly the same place as the demo which seems to run fine. Any ideas?

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

1 Answer 1

1

You probably need your class to implement the protocol: 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

... then implement those methods.

edit: changed implementation to interface, mybad.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.