ios - Assertion failure when trying to write data to Keychain -


i trying write array data keychain using code below

    // set keychain can write it... or read if needed (specially testing)     keychainitemwrapper* keychain = [[keychainitemwrapper alloc] initwithidentifier:@"keykeychain" accessgroup:nil];  //    write     nsdata *dataarr = [nskeyedarchiver archiveddatawithrootobject:parsedremotesitesmutablearray];      [keychain setobject:dataarr forkey:(__bridge id)(ksecattrgeneric)]; //    read     nsdata *myarr = [keychain objectforkey:(__bridge id)(ksecattrgeneric)];     nsarray *arraycopy = [nskeyedunarchiver unarchiveobjectwithdata:myarr]; //    log     nslog(@"%@", arraycopy); 

as can see converting nsarray nsdata trying store nsdata ksecattrgeneric reciving error below when tri setobject:forkey

assertion failure in -[keychainitemwrapper writetokeychain], /users/imac/documents/iphone applications/appname/appname/keychainitemwrapper.m:268 2013-07-22 13:54:39.952 key[2167:907] *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'couldn't add keychain item.' *** first throw call stack:etc... 

any appreciated.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -