NimbleKit - fast iOS app development

Settings Bundle

Problem discussions

Re: Settings Bundle

Postby apt » Wed Apr 21, 2010 3:10 pm

Thanks Sunny, will sent it to you later.

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 » Thu Apr 22, 2010 12:50 am

Sample project sent.

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 » Fri Apr 23, 2010 11:29 am

Sunny have you had a chance to look at the sample project I sent you regarding this issue?

Thanks

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 » Mon Apr 26, 2010 12:29 pm

Any news?
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 » Thu Apr 29, 2010 9:09 am

I'm sure you're very busy Sunny but some dialogue on this issue would be helpful.

Thanks in advance.
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 » Thu Apr 29, 2010 11:18 pm

it's not yet solved, I try to do things planned step by step, making half of this feature, then interrupt to make another half of the other feature will end up badly. You will have this with new version.
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Settings Bundle

Postby apt » Thu Apr 29, 2010 11:22 pm

Thanks Sunny :)
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 Apr 30, 2010 5:21 am

ok, it happens because of json conversion, this won't be changed in NimbleKit as it works in the rest of the cases.
for you there is a workaround, at the example you sent to me you use
Code: Select all
settings.setValueForKey(AppVersion, 'Version_key');

you need to replace it with this call:
Code: Select all
CallNKitAction("NKSettingsSetValueForKey?key="+'Version_key'+"&value="+AppVersion+"&sync=yes");

and your problem is solved
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Settings Bundle

Postby apt » Fri Apr 30, 2010 5:28 am

Wow thats great Sunny. Can you explain what CallNKitAction is and how it works as its not listed in the manual.

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 Apr 30, 2010 6:35 am

any action you call using nimblekit functions or class methods eventually end up using CallNKitAction (see NKit.js), for example:
Code: Select all
function NKSettings()
{
   this.getValueForKey = NKSettingsGetValueForKey;
   this.setValueForKey = NKSettingsSetValueForKey;
}

function NKSettingsSetValueForKey(value, key)
{
   return CallNKitAction("NKSettingsSetValueForKey?key="+key+"&value="+encodeURIComponent(json_encode(value))+"&sync=yes");
}

function NKSettingsGetValueForKey(key)
{
   var resultString = CallNKitAction("NKSettingsGetValueForKey?key="+key+"&sync=yes");
   var obj=null;
   try
   {eval("obj="+resultString);}
   catch ( identifier ) {}
   if (obj) return obj;
   else return resultString;
}

CallNKitAction is the only way to send/receive commands to NimbleKit, it is wrapped in classes and methods just to be simpler then it is.
In the example with NKSettings, setValueForKey actually calls
Code: Select all
CallNKitAction("NKSettingsSetValueForKey?key="+key+"&value="+encodeURIComponent(json_encode(value))+"&sync=yes");
which cases troubles for you in json_encode, so what I did is removed "json_encode" from that string and here you go, it works :)
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

PreviousNext

Return to Troubleshooting

Who is online

Users browsing this forum: Bing [Bot] and 1 guest