TListBox Items AddObject Firemonkey 10.2 [duplicate]

  

This question already has an answer here:

Delphi FireMonkey TListBox AddObject exception on Android

1 answer

I’m try on formShow add

ListBox1.Items.AddObject(‘TEST 1’, TObject(1)) ;
ListBox1.Items.AddObject(‘TEST 2’, TObject(2)) ;

but app automatically close (crash).

This example work fine

ListBox1.Items.Add(‘TEST 1’);
ListBox1.Items.Add(‘TEST 2’);

Any solution how use Items.AddObject?

Comments are closed.