objective c - "incompatible type in initializtion" -
my caller-code looks this:
nsdictionary *mydictionary = [nsdictionary dictionarywithobjectsandkeys: @"a", a_key, @"b", b_key, @"x", x_key, nil]; id exp = [[self brain] expression]; double result = [[self brain] evaluateexpression:exp usingvariablevalues:mydictionary]; -> error line
- expression defined as:
@property (readonly) id expression;
(i not think that's relevant)
the signature of function "evaluateexpression:exp..." is:
" + (double)evaluateexpression:(id)anexpression usingvariablevalues:(nsdictionary *)variables;"
the error receiving: "incompatible type in initializtion"
i can't figure 1 out - it's initializing double variable method returns double. doing wrong?
try changing plus @ beginning of method declaration minus. plus indicates class method, , you're (as far can tell) calling against instance.
i think above mistake causing compiler not know method returning double, hence error.
Comments
Post a Comment