10 Replies
      Latest reply on Dec 6, 2019 1:35 PM by simonfromhelix
      VincenDev Level 1 Level 1 (0 points)

        I'm trying to store a 2 separated Strings (73067 bytes) and (280628 bytes) to User Defaults, in older iOS versions just work fine, but in iOS 13, i can't save this data.

         

         

        This is how i save the data:

         

        UserDefaults.standard.set(myData1, forKey: KEY_MY_DATA_1)

        UserDefaults.standard.synchronize()

         

         

        UserDefaults.standard.set(myData2, forKey: KEY_MY_DATA_2)

        UserDefaults.standard.synchronize()

         

         

        Throws this error on iOS 13:

         

        2019-08-19 15:34:24.616570+0200 myAppName[4108:240228] [User Defaults] CFPrefsPlistSource<0x6000037cc980> (Domain: com.domain.myAppName, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): Attempting to store >= 4194304 bytes of data in CFPreferences/NSUserDefaults on this platform is invalid. This is a bug in myAppName or a library it uses.