custom properties in iOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 3
- Joined: Thu Feb 17, 2011 12:32 am
custom properties in iOS
We're building a iOS game and it includes a scrolling field with user profiles. We would like to save these profiles upon closing the app. Is there a way to use custom properties to save this data? We've tried custom properties and saving the substack upon closing the app, but to no avail. We know we can save to an external text file, but could we use custom properties?
Re: custom properties in iOS
Hi tikilittle,
no, custom properties are "just" another way to store information INSIDE of a stack.
They will also need to be stored/saved in external (text) files.
Best
Klaus
no, custom properties are "just" another way to store information INSIDE of a stack.
They will also need to be stored/saved in external (text) files.
Best
Klaus
-
- Posts: 111
- Joined: Sun Aug 23, 2009 7:48 am
- Contact:
Re: custom properties in iOS
My usual way of storing properties is to put them in an array. Then you could save the array by using arrayEncode. Like this:
:-Håkan
Code: Select all
put userName into prefs["uname"]
put wantsMusic into prefs["wantsMusic"]
put showNewsAtStart into prefs["showNewsAtStart"]
# To save, you convert your array into a "text"-file
put arrayEncode(prefs) into URL <filepath>
# To load your prefs you just do the reverse
put arrayDecode(URL <filepath>) into prefs
___________________________________
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3
Re: custom properties in iOS
you can simply save the stack, anywhere you'd store text files too.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- Livecode Opensource Backer
- Posts: 3
- Joined: Thu Feb 17, 2011 12:32 am
Re: custom properties in iOS
Thanks Klaus, Hakan & BvG.
We would like to report success finally at storing custom properties in an iPad application. We were able to follow the excellent tutorial posted by BN on this forum 30Jan2011 titled "Splashstack and datastack for iPhone". The key for us seemed to be to add our data stack to the "Non-stack files in the application" in the "Copy Files" tab of the "Standalone Application Settings". We also added the try-catch script from BN to find the data stack in the specialFolderPath("Documents") or the specialFolderPath("engine").
Todd & Jim
We would like to report success finally at storing custom properties in an iPad application. We were able to follow the excellent tutorial posted by BN on this forum 30Jan2011 titled "Splashstack and datastack for iPhone". The key for us seemed to be to add our data stack to the "Non-stack files in the application" in the "Copy Files" tab of the "Standalone Application Settings". We also added the try-catch script from BN to find the data stack in the specialFolderPath("Documents") or the specialFolderPath("engine").
Todd & Jim