Search code examples
iosdelegatesnskeyedarchivernsnotification

Delivering data between two viewControllers via “NSKeyedArchiver ” causes double “import” error?


I am a new iOS developer. These days, I have been stuck in a problem : delivering data between two viewControllers via “NSKeyedArchiver ” causes double “import”, by which I mean both the two viewControllers import each other.


Solution

  • The simplest way to share/stored data, if you don't want to use the methods you mentioned above, is to use NSUserDefaults. This is a local store that you can use to save off your data to. See docs here