Reputation: 304
I am building an iOS app using storyboards.I am sending login profile information to server and getting response from the server as a user id i want to save this id in my local file and use in my project in different classes.
I'm unable to do this could someone help me how i can do this.
Upvotes: 0
Views: 332
Reputation: 1618
Login data should not be stored in files or userdefault. I suggest storing it in an NSKeychain.
Additionally, if you need to keep it for local reference in current project scope, make a class that manages these properties and use dependency injection to pass around the class holding the properties.
check out the nsuserdefault docs for cases of when to use / not use them.
Upvotes: 1