Why am I getting an Objective-C error message: Incorrect conversion from 'objc_object *'

This error message was a little puzzled:

invalid conversion from 'objc_object * to' int '

The corresponding line was something like this:

int iResult = [MyUtils utilsMemberFunc:param1,param2];
+3
source share
1 answer

It doesn't matter what the "to" type is, it’s important that you acknowledge that this message in this context reports that the utilsMemberFunc declaration was not found, and because of the Objective-C dynamic binding, it is assuming that it returns an objc_object * object. not the type that utilsMemberFunc was declared.

So why doesn't he find a declaration? Because "," is used to separate parameters, not ":".

+6
source

Source: https://habr.com/ru/post/1697063/


All Articles