0

I am using NSUserDefault for storing user information in signUp Screen. I am using this data in different screens of my iOS app. when I UnInstall this app and install it again. the data is nil in different screens and also If RUN this app in another simulator by using this same credentials, that time also data is nil for different screens(different screens means like Home and Profile screens).

How to Solve this Problem??

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
ios ios
  • 53
  • 1
  • 3

1 Answers1

5

UserDeafults is store data inside app Preferences , So

• if you remove app then all UserDeafults data is removed • if you run on another simulator it mean another device so it haven't your stored data , so this normal behaviour

for more information about haw to work with user defaults check

How can I use UserDefaults in Swift?

Abdelahad Darwish
  • 5,969
  • 1
  • 17
  • 35