iOS Question Can instances of a class by used globally?

Derek Johnson

Active Member
Licensed User
I tried doing this:

B4X:
Main:

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    ...
    Public pm As clsPreferenceManager
End Sub
and then I tried to use this instance in another module

eg

B4X:
Sub Something
    pm.GetString("Location")
End Sub
but the object was not recognised.

Is this the expected behaviour - i.e. instances of classes cannot be Public?

Derek
 
Top