- (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/