iOS Question Error with AttributedString

Andrew Lindsay

Member
Licensed User
Longtime User
Hello,

using the following code, I get an error when I try to get the selected item.

B4X:
Dim att As AttributedString
Dim s As String

att.Initialize("",Null,Null)
att = Picker1.GetSelectedItem(0)
s = att.ToString   
  
Label6.Text = s

Any assistance would be appreciated.
 

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,
you don't have to initialize the AttributedString object, so just remove one line:

B4X:
Dim att As AttributedString
Dim s As String

att = Picker1.GetSelectedItem(0)
s = att.ToString  
 
Label6.Text = s

But this only works, when the item of the picker is an AttributedString ...
 
Upvote 0
Top