Is there an example showing how to load the items of an iPhoneList control? I tried doing it based upon the documentation, but I was unsuccessful. I was not certain which Async events and/or properties to use.
All I need is a code snippet that works asynchronously. Thanks!
Hi,
You can use the TIWiPhoneList.AsyncItemAdd call to asynchronously load new items to the control.
Example:
Example:
procedure TIWForm5.IWAppFormCreate(Sender: TObject);
var
I: Integer;
li: TIPhoneListItem;
begin
for I := 0 to 10 do
begin
li := TIWIPhoneList1.Items.Add;
li.Caption := 'Item ' + IntToStr(I + 1);
end;
end;
procedure TIWForm5.IWButton1AsyncClick(Sender: TObject;
EventParams: TStringList);
begin
with TIWIPhoneList1.Items.Add do
begin
Caption := 'new item';
end;
TIWIPhoneList1.AsyncItemAdd;
end;