iphone - Xcode:此方法之前缺少正确的分隔符

标签 iphone ios xcode4

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

在XCode 4中,“-(void)closeView {”行标记为黄色,警告是:“此方法之前缺少正确的分隔符”。

此警告是什么意思?

最佳答案

我必须在方法之前的行中添加“////////////////”!

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

我的代码在框架Three20的“TTThumbsViewController”内部。在每种方法之前都有这些斜杠:
https://github.com/facebook/three20/blob/master/src/Three20UI/Sources/TTThumbsViewController.m

关于iphone - Xcode:此方法之前缺少正确的分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8050120/

相关文章:

javascript - 如何使用适用于 android 和 iphone 的 javascript 检测长触摸压力?

ios - 在 TestFlight (iTunes Connect) 中为外部测试人员提交应用程序时出错

ios - 如何设置UICollectionViewCell大小

iphone - UILabel 多组值

iphone - 无法识别的选择器 -[UIView addSubView :]

iphone - 根据字符串内容更改字符串; (NSExpression 小数问题)。 Xcode

ios - iPhone 在后台收集 CoreMotion 数据。 (超过10分钟)

ios - 我需要清楚地了解导航 Controller

iphone - Xcode 线程 1 : Program recived signal: "EXC_BAD_ACCESS"

objective-c - 在gdb中调试objc时如何检查 'super'