Search code examples
iphoneiosxcode4

Xcode: This method is missing a correct divider before it


- (void)setDelegate:(id<MyDelegate>)delegate {
  _delegate = delegate;

  if (_delegate) {
    self.navigationItem.rightBarButtonItem =
    [[[UIBarButtonItem alloc] initWithTitle:@"Close"
                                      style:UIBarButtonItemStyleBordered
                                     target:self
                                     action:@selector(closeView)] autorelease];
  }
}

- (void)closeView {
    [self.navigationController dismissModalViewControllerAnimated:YES];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:NO];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
}

The line "- (void)closeView {" is marked yellow in XCode 4 and the warning is: "This method is missing a correct divider before it".

What does this warning means?


Solution

  • I had to add "//////////////////" in the line before the method!

    ///////////////////////////////////////
    - (void)closeView {
    }
    

    My code is inside "TTThumbsViewController" of the framework Three20. Before every method are these slashes: https://github.com/facebook/three20/blob/master/src/Three20UI/Sources/TTThumbsViewController.m