Saving profile in Iphone - iphone

In my app, I am writing some data, and I want to save it so that I can retrieve it later. How can I save it and where will it be saved?
Please suggest some ideas...

I think you want to store it in a database using Core Data. If you give more specifics I may be able to give a more specific answer.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html

NSUserDefaults would be the obvious suggestion.
Other suggestions would be to write it to a .plist file in the documents directory or use core-data depending on how much you would want to save.

Related

Saving screenshot to CoreData

I'm developing an app that I want the user to be able to take a screenshot with a button (this works, but it's stored to camera roll). I have a need to keep history of these screenshots along with site name, etc.
I've been reading that it's not recommended to save binary data in a sqlite db, so I've stumbled across core data. I'm still learning, but one question that comes to mind is this. Some recommend to save the filename to coredata and then save the image to document directory. I want to read the data back into a table view controller and have the image part of the cell. Will I need to resize the image to the size I want when reading in, or will it automatically size down to what it needs?
Also, when saving to document directory, are those files accessible from the camera roll? I don't want them to be and I'd like to give the user the ability to be able to delete them with the tableviewcontroller.
Please let me know if I need to expand on anything. I'm learning Swift, so I'm sure I missed something.
You should not save it to the Documents directory.
You should instead Allow External Storage of the attribute. Core Data will take care of storing it for you. This is explained in the answer by jansenmaarten to this question.

Is iCloud only meant for UIDocument and CoreData(How to Take Back up of any folder with its data on iCloud)

I read the apple documentation and some other links and found there are examples of using iCloud with only either UIDocument or Core Data.
I am having a folder created in documents directory named "backUPFolder" and it contains some images and other files in it.
I want to ask , if it is possible to move this backUPFolder in iCloud with all the data exist in this folder as it is.
If yes it is possible please provide me some useful link or suggest an approach which I can follow.
My requirement is to take a back up of my data on iCloud.
Please please help me.
I am stuck here.
Any suggestions would be highly appreciated.
Thanks in advance!
I have also only seen the UIDocument and Core Data examples. What comes to mind is to transform your pics and docs into Core Data blobs and store them with core data anyway. This could also be very efficient.
Alternatively, you could check out the Dropbox APIs.
If your folder in the Documents or Library folder of your application, it will be backed up to iCloud automatically assuming the user has iCloud enabled (and that you haven't explicitly flagged the file as NSURLIsExcludedFromBackupKey).
Any manual interaction with iCloud as a developer is typically to share files explicitly between installations of your app. If your requirement is just to back up data, you don't need to do anything besides store the folder in Documents.

How to save conversation history in instance messager?

I'm constructing an internal instance messager app which is very similar to whatapps. Can someone give me suggestions of how to save the conversation in the local device. Is it ok to archiver the whole UIViewController to save all the messages?
Thanks so much.
You have a number of choice , like you could store in sqllite database , As object using NSUserDefaults and as file in your application sandbox.
And file could be either xml or simple txt format.
Updated:
How to store custom objects in NSUserDefaults
No you need to save history either into NSUserDefaults or save into Sqlite Database.

Updated app has saved the original data

What is the trick that some apps after update keep original data saved before update for example scores or settings. I would like to use it with pList, but have not found how yet.
tnx
There's no trick. Anything you save to user defaults or your app's documents directory will be preserved in an update.
Just save it to a file in your "Documents" folder, or use NSUserPreferences.
Both are retained across updates.
I would expect NSUserDefaults to handle it correctly, but I could be wrong.

How to use Core Data in saving all the details which were stored or displayed in a table view?

I am developing an app which parses an Xml or RSS feeds of a magazine..The thing is I have to include an offline capability,ie save the previous results which were displayed in each cell(similar to the New York times app) and then display the saved ones when there is no network connection..
Please help me with the codewise explanation using Core data as I was suggested to use it for this particular task.
Will be of great help for me..
Looking forward for your replies
Regards and Thanks
Arun
You probably want to start here.
OH Boy... CoreData.
Good bye 3-4 days of learning how this works. You wont regret learning about core data but there is a LOT.
#OhioDude has a great link. You can also.
1. Xcode > file > New Project. Select Navigation Based App, make sure the coredata checkbox is checked. Viola you have a project with all the core data templates.
2. There is other sample code on Apples website.
One of the tricky and cool things about core data is that you if you deploy a new version you have to write a template of how you app is to roll the data into the new structure.
During dev as I am changing the DB structure, I seem to get errors, so I just do a build>clean. And rename the string for the DB file to something new.
Good luck. Otherwise NSUserDefaults will be fine.
Or just learn about PLIST's you can simply serialize a NSDictionarly object into a PLIST and save it to the disk in a few lines of code. SUPER easy and no stuffing around with CoreData.