ios - 错误 : Expect ")" before CLLocation

标签 ios objective-c

我遇到了这个错误:

Expect ")" before CLLocation

我的代码:

MyAppDelegate.h

@protocol AskerConnectionDelegate
-(void) postNewQuestionForUserID: (NSString*)uID Text: (NSString*)text location: (CLLocation*)loc; 

@end

最佳答案

您应该导入必要的头文件。

#import <MapKit/MapKit.h>

或者在@protocol声明之前添加一个@class指令,

@class CLLocation;

添加 @class 指令只是让编译器知道特定类的存在,而无需导入头文件。

关于ios - 错误 : Expect ")" before CLLocation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7738264/

相关文章:

ios - 谷歌地图背景是灰色的

ios - UITableViewCell 自定义分隔符在滚动 ios8 期间消失

ios - 一个 id 数组,用于通过 NSPredicate 过滤数组

ios - 应用反馈表

objective-c - 为什么在尝试显示模态视图时出现 CoreAnimation 异常?

ios - layoutIfNeeded 在 iPad 上不起作用

objective-c - 为我的应用修改 SBJson 框架

ios - 将 Xamarin iOS 提交到 Apple AppStoreConnect TestFlight 后获取 'ITMS-90338: Non-public API usage' 和 'ITMS-90809: Deprecated API Usage'

objective-c - View 何时创建?

ios - swift 4 错误 : '-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread