Saving Changes in iOS

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving Changes in iOS

Matthias Rebbe via use-livecode
I know I’m out to lunch again, but I notice that one cannot use the ol’ Launcher+MainStack method in iOS to save user changes. What’s up with that? How does one save user changes in iOS?

Thanks,

Roger
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode
Hi Roger,

> Am 29.01.2018 um 16:14 schrieb Roger Guay via use-livecode <[hidden email]>:
>
> I know I’m out to lunch again, but I notice that one cannot use the ol’ Launcher+MainStack method in iOS to save user changes. What’s up with that? How does one save user changes in iOS?

copy your MAIN stack to the users documents folder on first launch
and open and save it from there!

> Thanks,
>
> Roger

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Saving Changes in iOS

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
Roger,

On Android and iOS "the engine folder" is read only. Any files/stacks you want to save/modify must be moved to "the documents folder" or "the temporary folder" before they can be modified/saved.

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]

-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf Of Roger Guay via use-livecode
Sent: Monday, January 29, 2018 10:15 AM
To: [hidden email]
Cc: Roger Guay
Subject: Saving Changes in iOS

I know I’m out to lunch again, but I notice that one cannot use the ol’ Launcher+MainStack method in iOS to save user changes. What’s up with that? How does one save user changes in iOS?

Thanks,

Roger
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode
Sorry Klaus and Ralph, but I’m not getting it. How/where do I find the "the documents folder" or "the temporary folder”?

(Preparing right hand for dope-slap)

Thanks,
Roger

> On Jan 29, 2018, at 8:30 AM, Ralph DiMola <[hidden email]> wrote:
>
> Roger,
>
> On Android and iOS "the engine folder" is read only. Any files/stacks you want to save/modify must be moved to "the documents folder" or "the temporary folder" before they can be modified/saved.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
> -----Original Message-----
> From: use-livecode [mailto:[hidden email]] On Behalf Of Roger Guay via use-livecode
> Sent: Monday, January 29, 2018 10:15 AM
> To: [hidden email]
> Cc: Roger Guay
> Subject: Saving Changes in iOS
>
> I know I’m out to lunch again, but I notice that one cannot use the ol’ Launcher+MainStack method in iOS to save user changes. What’s up with that? How does one save user changes in iOS?
>
> Thanks,
>
> Roger
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode
Hi Roger,

> Am 29.01.2018 um 17:17 schrieb Roger Guay via use-livecode <[hidden email]>:
>
> Sorry Klaus and Ralph, but I’m not getting it. How/where do I find the "the documents folder" or "the temporary folder”?

You already named it:
the documents folder
the temporary folder

Is equivalent to:
specialfolderpath("documents")
specialfolderpath("temporary")

> (Preparing right hand for dope-slap)
> Thanks,
> Roger
>
>> On Jan 29, 2018, at 8:30 AM, Ralph DiMola <[hidden email]> wrote:
>>
>> Roger,
>> On Android and iOS "the engine folder" is read only. Any files/stacks you want to save/modify must be moved to "the documents folder" or "the temporary folder" before they can be modified/saved.

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode
Hi Klaus,

So are you saying that I create a folder called "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the Standalone Application Settings, and put my MainStack into it?

Thanks,
Roger

> On Jan 29, 2018, at 9:21 AM, Klaus major-k via use-livecode <[hidden email]> wrote:
>
> You already named it:
> the documents folder
> the temporary folder
>
> Is equivalent to:
> specialfolderpath("documents")
> specialfolderpath("temporary")
>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode
Hi Roger,

> Am 29.01.2018 um 18:41 schrieb Roger Guay via use-livecode <[hidden email]>:
>
> Hi Klaus,
>
> So are you saying that I create a folder called "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the Standalone Application Settings, and put my MainStack into it?

no, I'm not saying this! :-)
Please read up the specialfolderpath() section in the dictionary.

1. specialfolderpath("documents”) is the folder inside of the application bundle where we have write permissions!
It is already there, do NOT try to create it!

2. Add your "main" stack via the "Copy files" to your app.

3. Then do this when the app (launcher) starts (preopenstack or openstack)
...
## Stack in users docs folder, where we have write permissions, means where we can SAVE that stack:
put specialfoderpath("documents") & "/your mainstack here.livecode" into tTargetStack

## This is the stack you added via "Copy files":
put specialfoderpath("resources") & "/your mainstack here.livecode" into tSourceStack

## check if the app had already been opened before:
if there is NOT a file tTargetStack then
  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
end if

## Now open that new stack in the users docs folder and save it later without problems:
go stack tTargetStack
...

And don't forget to add:
...
start using this stack
...
to your LAUNCHER Stack before opening other stacks, so your separate "main" stack can use
all of its scripts, libraries, externals etc.

> Thanks,
> Roger

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS

Matthias Rebbe via use-livecode


> Am 29.01.2018 um 18:57 schrieb Klaus major-k via use-livecode <[hidden email]>:
>
> Hi Roger,
>
>> Am 29.01.2018 um 18:41 schrieb Roger Guay via use-livecode <[hidden email]>:
>>
>> Hi Klaus,
>>
>> So are you saying that I create a folder called "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the Standalone Application Settings, and put my MainStack into it?
>
> no, I'm not saying this! :-)
> Please read up the specialfolderpath() section in the dictionary.
>
> 1. specialfolderpath("documents”) is the folder inside of the application bundle where we have write permissions!
> It is already there, do NOT try to create it!

Addition, this only applies to iOS and Android!

On desktop, the documents folder is on oyur hard disk, to see it on your machine, use the message box:
answer specialfolderpath("documents")

> 2. Add your "main" stack via the "Copy files" to your app.
>
> 3. Then do this when the app (launcher) starts (preopenstack or openstack)
> ...
> ## Stack in users docs folder, where we have write permissions, means where we can SAVE that stack:
> put specialfoderpath("documents") & "/your mainstack here.livecode" into tTargetStack
>
> ## This is the stack you added via "Copy files":
> put specialfoderpath("resources") & "/your mainstack here.livecode" into tSourceStack
>
> ## check if the app had already been opened before:
> if there is NOT a file tTargetStack then
>  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
> end if
>
> ## Now open that new stack in the users docs folder and save it later without problems:
> go stack tTargetStack
> ...
>
> And don't forget to add:
> ...
> start using this stack
> ...
> to your LAUNCHER Stack before opening other stacks, so your separate "main" stack can use
> all of its scripts, libraries, externals etc.
--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Saving Changes in iOS

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
The folders already exists. You can of course create sub-folders. In iOS "the Documents folder" is automatically backed up but "the Temporary Folder" is not. Apple reviewers will get upset if you put too much into the documents folder. You will be required to either move files to the temporary folder or mark them as "No Backup". Using iphoneDoNotBackupFile.

Example:

Put URL("File:"&the engine folder&slash&"MyDatabase.db") into url ("File:"&the documents folder&slash&"MyDatabase.db")
put revOpenDatabase("sqlite", the documents folder&slash&"MyDatabase.db"), , ,) into tDatabaseID

You would put MyDatabase.db in the copy file pane of the standalone settings.


Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf Of Roger Guay via use-livecode
Sent: Monday, January 29, 2018 12:41 PM
To: How to use LiveCode
Cc: Roger Guay
Subject: Re: Saving Changes in iOS

Hi Klaus,

So are you saying that I create a folder called "specialfolderpath("documents”)”, add this folder to the “Copy Files” of the Standalone Application Settings, and put my MainStack into it?

Thanks,
Roger

> On Jan 29, 2018, at 9:21 AM, Klaus major-k via use-livecode <[hidden email]> wrote:
>
> You already named it:
> the documents folder
> the temporary folder
>
> Is equivalent to:
> specialfolderpath("documents")
> specialfolderpath("temporary")
>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Saving Changes in iOS - Solved

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
Thanks to Ralph and Klaus, I’ve succeeded in building my first iOS app that saves user data. The following post form Klaus did it.


> Please read up the specialfolderpath() section in the dictionary.
>
> 1. specialfolderpath("documents”) is the folder inside of the application bundle where we have write permissions!
> It is already there, do NOT try to create it!
>
> 2. Add your "main" stack via the "Copy files" to your app.
>
> 3. Then do this when the app (launcher) starts (preopenstack or openstack)
> ...
> ## Stack in users docs folder, where we have write permissions, means where we can SAVE that stack:
> put specialfolderpath("documents") & "/your mainstack here.livecode" into tTargetStack
>
> ## This is the stack you added via "Copy files":
> put specialfolderpath("resources") & "/your mainstack here.livecode" into tSourceStack
>
> ## check if the app had already been opened before:
> if there is NOT a file tTargetStack then
>  put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
> end if
>
> ## Now open that new stack in the users docs folder and save it later without problems:
> go stack tTargetStack
> ...
>
> And don't forget to add:
> ...
> start using this stack…

This should be a tutorial somewhere.

Thanks again guys. Especially for being patient with me!!

Roger

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode