Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalid argument type 'void' to unary expression

I'm writing iOS app and I've got this error:

Invalid argument type 'void' to unary expression

Here's the code:

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
  //code here
}
like image 526
Valeriy Antonov Avatar asked Jan 25 '26 12:01

Valeriy Antonov


2 Answers

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.

like image 129
Alladinian Avatar answered Jan 28 '26 02:01

Alladinian


Check the lines above your function. Do you have unbalanced parantheses? Did you declare some incomplete statement?

like image 22
nullp01nter Avatar answered Jan 28 '26 00:01

nullp01nter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!