Recent

Author Topic: [SOLVED] NSDictionary error incompatible type for arg1  (Read 1671 times)

Josh

  • Hero Member
  • *****
  • Posts: 1271
[SOLVED] NSDictionary error incompatible type for arg1
« on: June 12, 2021, 02:37:09 pm »
https://wiki.freepascal.org/Mac_Show_Application_Title,_Version,_and_Company

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

« Last Edit: June 12, 2021, 03:00:32 pm by josh »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: NSDictionary error incompatible type for arg1
« Reply #1 on: June 12, 2021, 02:45:39 pm »
Try adding {$modeswitch objectivec2} at the top of your program (but below any {$mode xxx} directives).

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: NSDictionary error incompatible type for arg1
« Reply #2 on: June 12, 2021, 03:00:11 pm »
Thanks that solved the problem.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018