5

I have a project with two different targets (a free and a paid version of the same app) and I have a list with items that I save to NSUserDefaults. My question is, is there any way to share this list between the two version of the app, without using KeyChain or something similar ?

Gürhan KODALAK
  • 570
  • 7
  • 20
smeshko
  • 1,184
  • 13
  • 27
  • Using app groups it will be possible to share files or database. Check this http://stackoverflow.com/questions/24387871/share-datas-between-two-apps-with-ios-8-app-groups-using-nsuserdefaults – Leena Jun 04 '15 at 08:43
  • this is a hacking question....seems to be you are doing some free work for paid versions... – Ghanshyam Tomar Jun 04 '15 at 08:50
  • @GhanshyamTomar no, the idea is, that the user may use the free version for a while and then move to the paid one. I want to be able to import his saved items from the free app. – smeshko Jun 04 '15 at 08:54
  • @Leena gave you good suggestion and i think there is way to make a list item to file like json or db somethings and export to external folder...and then get it when you want from there... – Ghanshyam Tomar Jun 04 '15 at 08:58
  • 3
    IT IS NOT DUPLICATED QUESTION. Sharing data between targets is not the same as sharing data between apps. One app can have a few targets. – Bartłomiej Semańczyk Aug 26 '15 at 08:03

1 Answers1

5

Your can use App Group and save items in it. Project -> Capabilities -> App Groups

  1. Add App Group in your targets

  2. Using NSUserDefaults

ex:

NSUserDefaults *myDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.group.identifier"];
0yeoj
  • 4,500
  • 3
  • 23
  • 41
s100i29
  • 221
  • 2
  • 6