Questions tagged [data-persistence]
256 questions
0
votes
1 answer
Data Persistence
When the app is loaded, I want to know whether I have already saved the data to disk. If it is saved, I just load from disk, if not, I save.
for example, I want to save an array(person) using NSUserDefaults.standardUserDefaults()
Save Method:
let…

Bog
- 37
- 5
0
votes
1 answer
Grails doesn't save when using findAll but does when using collection
I have this code:
void updateIndex() {
Visit.withNewSession {
def results = patient.visits.sort{ it.date }
results.eachWithIndex { item, index ->
item.index = index
}
}
}
This saves to the DB without a…

Zaccak Solutions
- 249
- 3
- 10
0
votes
1 answer
writing to Application Support directory
I am trying to write to ApplicationSupport directory using this code. When I click the button, I get an error than an optinal value was nil. What is the correct way to write files to ApplicationSupport directory?
class ViewController:…

potato
- 4,479
- 7
- 42
- 99
0
votes
1 answer
NSUserDefaults does not persist data
I am using user defaults to store information between app launches. This is the code I am using in App Delegate:
var kaki: Bool!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) ->…

potato
- 4,479
- 7
- 42
- 99
0
votes
1 answer
Why does NSUserDefaults always return nil?
I'm testing this code in playground. What I don't understand is, why is result always nil? Thanks for help
var value: String!
let key = "key24"
if value == nil{
value = "hehe"
let valueNS = NSString(string: value)
…

potato
- 4,479
- 7
- 42
- 99
0
votes
1 answer
save array to a file using writeToURL method
I'm trying to save array to a file in Application Support folder.
This is the code I am using:
override func viewDidLoad() {
super.viewDidLoad()
let fileManager = NSFileManager()
var suppUrl = try!…

potato
- 4,479
- 7
- 42
- 99
0
votes
0 answers
NSkeyedUnarchiver making mutable array go null
I am trying to write a mutable array of custom objects, which has 5 data objects, to the disk. However, using the unarchiver always makes my array go null, and I cannot figure out why. Here is the method: (self.toDoItems is an NSMutableArray defined…

Zach
- 85
- 1
- 1
- 9
0
votes
1 answer
Is the current user object saved even when an app is closed using Parse?
I am using Parse as the back end for my Android app and I noticed that even when I close my app completely, the current user is always the same user object from my Parse Cloud storage. Is this a feature of Parse or is the current user persistent…

user1448016
- 51
- 1
0
votes
1 answer
JPA retrieve objects from database
I'm triying to solve a Java programming exercise for the universisty, but I don't know how to solve the next problem. I have the next persistence.xml file:

pez_betta
- 69
- 1
- 8
0
votes
2 answers
Scala and persistence framework version incompatible
I try to use slick and squeryl framework for data persistence with scala. I don't want to use Play framework, but just the persistence framework, but when I import slick (or squeryl) jar file, I encountered the issue below:
slick_2.10.1-2.0.0-M1.jar…

Sy Z
- 441
- 1
- 5
- 10
0
votes
2 answers
ASP.NET server data persistence
I'm not really sure exactly how the question should be phrased, so please be patient if I ask the wrong thing.
I'm writing an ASP.NET application using VB as the code behind language. I have a data access class that connects to the DB to run the…

Wayne Werner
- 49,299
- 29
- 200
- 290
0
votes
1 answer
Is it possible to store styled text persistently?
So I was trying to serialize some DefaultStyledDocument objects using XMLEncoder. They encode just fine, however when I look at the data, it doesn't encode any actually data, it just gives the class file. I've looked on the internet and saw that…

DonyorM
- 1,760
- 1
- 20
- 34
0
votes
2 answers
Docker: data volume container is not instantiated with `docker create` command
So, I'm trying to package my WordPress image in a way that all files except the uploads are persisted. In order to do so, I have created my Dockerfile which uses the official WordPress image as its base, and adds the files from an archive…

finferflu
- 1,368
- 2
- 11
- 28
0
votes
1 answer
Persistent data at runtime
Is there a way to persist data in a view during Runtime only, as user navigates between views.
ie user answers a question in a view sets a bool flag so if user navigates back to question view the question is already answered .
When user quits app…

dancingbush
- 2,131
- 5
- 30
- 66
0
votes
1 answer
Is using a singleton to store data incorrect in android?
This is a practice I've been using for a while now, but it seem to be deprecated, the literature seems to say that the correct way to save and restore data when the screen goes to the background or rotates is fragments.
I would like your opinion on…

Cruces
- 3,029
- 1
- 26
- 55