PDKeychain is not storing the data ( swift ) -


i have added pdkechainbindingscontroller.m & h files + pdkeychainbindings.m & h files swift project.

i have created bridge header.h file.

then included pdkeychain header files in bridge file:

#import "pdkeychainbindings.h" #import "pdkeychainbindingscontroller.h" 

i have rewritten existing objective c code in swift shown below.

var url:nsurl = nsurl(string: shopurl.text) var securestore: pdkeychainbindings = pdkeychainbindings() securestore.setobject("url", forkey: "shopurl") var usernamesecured:nsstring = nsstring(string: username.text) securestore.setobject("usernamesecured", forkey: "username") var passwordsecured:nsstring = nsstring(string: password.text) securestore.setobject("passwordsecured", forkey: "password") 

i cannot store information reason. getting error:

could not store(add) string. error was:-34018

any appreciated. thank you.

edit: have far , no joy :(

let url = nsurl(string: shopurl.text) let securestore: pdkeychainbindings = pdkeychainbindings() securestore.setobject("url", forkey: "shopurl")  let secureusername: pdkeychainbindings = pdkeychainbindings() let usernamesecured = nsstring(string: username.text) secureusername.setobject("usernamesecured", forkey: "username") let securepassword: pdkeychainbindings = pdkeychainbindings() let passwordsecured = nsstring(string: password.text) securepassword.setobject("passwordsecured", forkey: "password") 

debug info:

url nsurl * @"sdsdfsdf" 0x0b44cf40 securestore pdkeychainbindings * 0x0b4076b0 0x0b4076b0 secureusername pdkeychainbindings * 0x0b218510 0x0b218510 usernamesecured nsstring nsobject nsobject securepassword pdkeychainbindings * 0x0b452420 0x0b452420 passwordsecured nsstring

more modification:

i have done these changes below still unable save values.

var _username = username.text pdkeychainbindings.sharedkeychainbindings().setobject(_username, forkey: "usernamekey") var usernameoutput: anyobject? = pdkeychainbindings.sharedkeychainbindings().objectforkey("usernamekey") 


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -