Forum > macOS / Mac OS X

[SOLVED] NSDictionary error incompatible type for arg1



Following the above article to create an about box; and at the line
dict := NSDictionary.alloc.initWithObjectsAndKeys(Val1, Key1, Val2, Key2, Val3, Key3, Val4, Key4, Val5, Key5, Nil);
I get error at Val1 : Incompatible type for arg no.1 got "nsstring" expected "id"

What have I done wrong, could not find other examples

Jonas Maebe:
Try adding {$modeswitch objectivec2} at the top of your program (but below any {$mode xxx} directives).

Thanks that solved the problem.


[0] Message Index

Go to full version