Avatar of techques
 asked on

How to keep application session and store data in sqlite in iphone app?

There are 4 buttons that let user to click. When he clicks one of the buttons, I want to save the button id or value in application session until he closes the app.

How can I do it?

Secondly, how can I insert, update, delete, select data in sqlite in iphone app?

CiPhoneSwift Programming

Avatar of undefined
Last Comment

8/22/2022 - Mon

I think you need to split the question for two. There is no any relation between them

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

I think I do not need to use sqlite. How can I keep the value in a multi dimension arrays?


If you just need it for the life of the application (not after exit/relaunch), just use an app delegate variable.  Otherwise, create a core data entity and persist/retrieve the objects as necessary.  Here's a tutorial:


Multi dimension arrays can be solved with related entities.  For example, a widget group has widgets, and each widget has components.  You'd model a WidgetGroup, a Widget, and a WidgetComponent entity, and model the relationships accordingly (setting the multiplicity to one-to-many, or even many-to-many).
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy

Dear Sir

I read http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html

but still not understand how to assign a UIButton value to a delegate variable.

I do not need core data entity.

I just want to create a global variable and can get it across ViewController.m

Do you know any online tutorial in youtube or somewhere else?

Thanks for your great help.