B4i Library Key Value Store works on Device but not on Simulator

Discussion in 'iOS Libraries' started by ajk, Aug 2, 2018.

  1. ajk

    ajk Active Member Licensed User

    When I run Key Value Store on Simulator (on device is OK) then I always get NULL as the operation result of:

    result=kvsM.Get("sthStoredInKVS")

    Am I making some mistake while running program on Simulator?
     
  2. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    The Key Value Store is bound to the Apple account. Maybe your simulator is not connected to an Apple ID.
     
  3. ajk

    ajk Active Member Licensed User

  4. tufanv

    tufanv Expert Licensed User

    Keyvaluestore is not related to apple account that is keychain.
    It should work on simulator , how do you initialize the keyvaluestore and how do you put information , can you paste your code ?
     
  5. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    I thought he meant the "Keychain" sorry.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Works fine here with the simulator. Tested with this code:
    Code:
    Sub Process_Globals
       
    Public App As Application
       
    Public NavControl As NavigationController
       
    Private Page1 As Page
       
    Private kvs As KeyValueStore
    End Sub

    Private Sub Application_Start (Nav As NavigationController)
       NavControl = Nav
       Page1.Initialize(
    "Page1")
       Page1.Title = 
    "Page 1"
       Page1.RootPanel.Color = 
    Colors.White
       NavControl.ShowPage(Page1)
       kvs.Initialize(
    File.DirDocuments, "test.dat")
       
    Log(kvs.GetDefault("test""N/A"))
       kvs.Put(
    "test""alskdjalksdj")
    End Sub
    I can only guess that your simulator deletes the previous app data when you reinstall it for some reason.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice