Initializing object

gehrlekrona

Member
Licensed User
Longtime User
I have a problem that I can't seems to be able to fix.The error, when I start the app on the phone is"Object should first be initialized (Label) I have a few lables so I am not sure which one it is but why would I get an error like that?
 

NJDude

Expert
Licensed User
Longtime User
If you are modifying the Label and the label hasn't been initialized you will get this error, say for example, you are changing the text of a label and the label is not initialized the error you described will popup.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
If you use the designer to create your layouts you have to click on: Tools -> Generate Members and B4A will initialize them automatically but if you do it manually then you will have to do something like:

B4X:
Dim MyLabel As Label

MyLabel.Initialize("MyLabel")
 
Upvote 0

gehrlekrona

Member
Licensed User
Longtime User
If you use the designer to create your layouts you have to click on: Tools -> Generate Members and B4A will initialize them automatically but if you do it manually then you will have to do something like:

B4X:
Dim MyLabel As Label

MyLabel.Initialize("MyLabel")

AHHHh... that explains it. I have other labels in the Layout but this one I have added in code :) THANKS A LOT!
 
Upvote 0
Top