Search code examples
iphoneipadkeychaindata-sharing

Sharing Objects between 2 different iPhone applications


We are requiring to share some information between 2 different iPhone applications which are part of suite. Let say we want to share some objects between those 2 applications like array.

After some search we found GenericKeychain demo application from APPLE itself which shows use of generic keychain to share information between 2 different applications.

In that demo they have shown how to share string but what we want to achieve is to share an array of objects between applications. We tried a lot to do the same in demo application but somehow couldn't get required result and was always crashing when tried to put object for sharing. Can someone please light on this topic ?


Solution

  • Referring to your answer "I tried to add NSMutableArray instead of string in that application but it crashes with [__NSArrayM dataUsingEncoding:]: unrecognized selector sent to instance"

    Try putting dataUsingEncoding: in the documentation search you will see that its a method of nsstring class not nsarray. Use another method of getting data like mentioned in this post:

    How to convert NSArray to NSData?