3

我正在编写 iOS 应用程序,但出现此错误:

一元表达式的参数类型“void”无效

这是代码:

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
  //code here
}
4

2 回答 2

7

You got your method inside another method's body (maybe you've missed to type its closing } ?). That's why you get the error. Try to move it outside somewhere in your .m file.

于 2012-10-01T13:21:13.133 回答
1

检查函数上方的行。你有不平衡的parantheses吗?您是否声明了一些不完整的声明?

于 2012-10-01T11:20:27.967 回答