AlanKley
AlanKley

Reputation: 4780

Why am I getting this Objective-C error message: invalid conversion from 'objc_object*'

This error message had me stumped for a while:

invalid conversion from 'objc_object* to 'int'

The line in question was something like this:

int iResult = [MyUtils utilsMemberFunc:param1,param2];

Upvotes: 3

Views: 1710

Answers (1)

AlanKley
AlanKley

Reputation: 4780

It doesn't matter what the "to" type is, what is important is that you recognize that this message, in this context, is reporting that the utilsMemberFunc declaration was not found and due to Objective-C's dynamic binding it is assuming it returns an objc_object* rather than the type that utilsMemberFunc was declared to return.

So why isn't it finding the declaration? Because ',' is being used rather than ':' to separate the parameters.

Upvotes: 6

Related Questions