NimbleKit - fast iOS app development

Settings Bundle

Problem discussions

Settings Bundle

Postby tarnfeld » Tue Sep 01, 2009 10:36 am

For some reason getting the value of a "PSMultiValueSpecifier" item in a settings.bundle returns null?
Is there any reason of this? :(
tarnfeld
 
Posts: 189
Joined: Mon Jun 15, 2009 9:37 pm

Re: Settings Bundle

Postby sunny » Wed Sep 02, 2009 11:24 pm

nimblekit by default does not support any bundles (unless you mastered to do it).
with NKSettings you can save some variable with settings.setValueForKey() and then read it back using settings.getValueForKey().
it's not automatically updated, what I mean

var settings = new NKSettings();
settings.setValueForKey("5", "SomeNumber");
var saved_number = settings.getValueForKey("SomeNumber"); // saved_number now 5
saved_number = 10; // now it's 10, but in settings it's still 5, so if you want it to be saved you call
settings.setValueForKey(saved_number, "SomeNumber"); // now it's number 10 saved for "SomeNumber" key

so basically you can read from prefs only what you put there and saved values persist with application launches
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Settings Bundle

Postby tarnfeld » Fri Sep 18, 2009 7:48 pm

Hi,
I am not sure what you have done - or misunderstood me... but i was right, i knew i was!

I just made the settings.bundle (for the iphone settings app) and just set / got the value of it from your NKSettings();

! haha
tarnfeld
 
Posts: 189
Joined: Mon Jun 15, 2009 9:37 pm

Re: Settings Bundle

Postby apt » Fri Feb 12, 2010 12:57 pm

I recently raised 'setting' integration as a feature request but was told by Sunny that you (tarnfeld) have already successfully implemented this. Would be useful if you could share your technique and or code as this is something I would be interested in implementing.

Thanks in advance.

Adrian
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 356
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Settings Bundle

Postby sunny » Fri Feb 12, 2010 1:05 pm

well, to implement settings bundle you don't need even single line of obj-c code, that's why I can't integrate that in NimbleKit, you can check also http://www.iphonesdkarticles.com/2008/0 ... ences.html and create settings bundle as described there. But instead of obj-c
Code: Select all
NSString *sliderValue = [[NSUserDefaults standardUserDefaults] stringForKey:@"slider_key"];
you will need to use NK analog
Code: Select all
settings.getValueForKey
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Settings Bundle

Postby apt » Tue Mar 02, 2010 1:07 pm

sunny wrote:you will need to use NK analog
Code: Select all
settings.getValueForKey


Can you elaborate on this? I've successfully created a setting bundle but stuck on how to use setting.getValueForKey to read the setting into the app. What's the correct syntax?

Thanks in advance.

Adrian
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 356
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Settings Bundle

Postby apt » Wed Mar 03, 2010 3:51 pm

I know your busy on 1.7 but can I bump this topic :)

Adrian
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 356
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Settings Bundle

Postby sunny » Wed Mar 03, 2010 8:00 pm

what is the problem exactly? send sample application to me and I'll fix/add what is needed (but first write in e-mail what is needed exactly)
sunny@nimblekit.com
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Settings Bundle

Postby apt » Wed Mar 03, 2010 8:46 pm

Thanks Sunny, Email sent.
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 356
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Settings Bundle

Postby apt » Mon Apr 19, 2010 7:47 pm

Sunny, I never quite resolved this issue interacting using the setting bundle.

In this instance I'm wanting to change a value in the setting bundle based on the version of the app using NKGetAppVersion (The setting bundle will always automatically update to reflect the version number when its changed). This is what I have so far but I dont think I'm anywhere near a solution.

AppVersion=NKGetAppVersion();
[[NSUserDefaults standardUserDefaults] stringForKey:@"Version"] = AppVersion;

Thanks in advance.

Adrian
Last edited by apt on Mon Apr 19, 2010 11:22 pm, edited 2 times in total.
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 356
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Next

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 2 guests