Discussion Forums  >  Suggestions, Ideas, Wish List

Replies: 7    Views: 125

zYx
Lost but trying
Profile
Posts: 5
Reg: Jun 13, 2012
Pembury, uk
3,850
06/13/12 06:49 PM (13 years ago)

A Checklist app with checkboxes or switches

Hi there, I did some watching today, did few simple "apps" using xcode. I'd like to create a little app with a list of items to be ticked/checked when completed. Since this is my first app, I'm not sure how to save the state of the app, so when you launch this app again later, items previously ticked, are still ticked, I will need to read a lot more about all this code, but a sample code would help me a lot as well. Sometime it's better for me if I start learning from the end :P Cheers everyone!
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
06/13/12 07:03 PM (13 years ago)
function get_cookie ( cookie_name ) { var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' ); if ( results ) return ( unescape ( results[2] ) ); else return null; } function set(){ if(get_cookie("checklist")) document.getElementById("checklist").value=get_cookie("checklist"); } window.onload=set;
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
06/13/12 07:03 PM (13 years ago)
the code i gave you is if your using html or javascript in something like an html document. this is the only way i know how to save something. theres people in these forums that know much more than me about programming but i hope i could help if your doing javascript.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/13/12 07:44 PM (13 years ago)
@ceerup helped develop a note pad using session storage which I documented (albit incompletely) in my localStorage article in my guide. He knows more than he's declaring. www.MySkylla.com Go to JSON, HTML. . . Fred
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
06/13/12 08:01 PM (13 years ago)
i think he can probably do something similar but just add boxes to check <input type="checkbox"> but make the checkbox have a variable
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/13/12 08:11 PM (13 years ago)
That's what I was thinking. Fred
 
zYx
Lost but trying
Profile
Posts: 5
Reg: Jun 13, 2012
Pembury, uk
3,850
like
06/16/12 10:34 AM (13 years ago)
Thanks for all the replies. ceerup, how do I apply your code? When HTML coockied are used, are they saved on the device? I'm trying to implement this code in my HTML document, but so far I have no luck. Can this be done graphically by any chance? Or perhaps I could just use simple switches?
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/27/12 02:52 AM (13 years ago)
I was scrolling through Parse today and found a solution to add checklist on bt apps.. https://parse.com/tutorials/todo-app-with-javascript You must have an account with Parse.. Its pretty neat and based on this original script: https://github.com/addyosmani/todomvc or http://todomvc.com/
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.