NSUserDefault issue with iOS10 [duplicate] - ios

This question already has answers here:
iOS 10, NSUserDefaults Does Not Work
(4 answers)
Closed 6 years ago.
Have a similar problem with this iOS 10, NSUserDefaults Does Not Work
Seems like NSUserDefault is not working in iOS 10 simulator when it previously run iOS 8 or 9. But my question is, would it be okay on the device itself? When it is downloaded by the user using iOS10, would it lend to some bug or crash?

NSUserDefault will work fine on device, i am using it in my app. I haven't faced any such issues. Try to run your app in a device, i am sure you won't face any issues.
If possible please share the code, there is a possibility that you might be missing on something

Related

Retrieving MY iOS app's files from the App Store [duplicate]

This question already has answers here:
How to reverse engineer an Xcode project from an app?
(2 answers)
Closed 3 years ago.
Recently, I accidentally overwrote my iOS app on my Mac. But I uploaded to Apple Connect for testing. Is there a way to retrieve the files of my app from there?
No. What you uploaded to App Store Connect is compiled code. What you are looking for is your source code (text).

Is there a method that gets called on app uninstallation? [duplicate]

This question already has answers here:
Detect iOS application about to delete?
(3 answers)
Closed 4 years ago.
I have a very specific need to handle some cases if my iOS app gets uninstalled. But I cannot find any method so far that gets called in case the app gets uninstalled. I have searched around with similar questions but cannot find anything usefull. Can anyone suggest something please.
No, its not possible.
But you can check if the application has re-installed by storing a key in iCloud using keychain.

Unique way of identifing an iphone [duplicate]

This question already has answers here:
Unique Identification of iOS device for iOS 7.0 and above
(6 answers)
Closed 4 years ago.
I'm working on an app that has a code authentication, in order to do that I have to know what device has activated the code. Is there a unique ID or something like that, that does not change even if the app gets reinstalled?
You can use the identifierforvendor for this
UIDevice.current.identifierForVendor!.uuidString

How to move Core data database from my simulator to Real device by swift? [duplicate]

This question already has answers here:
iOS ship application with pre populated sqlite database [closed]
(2 answers)
Closed 7 years ago.
I am making an app that use Core data for as the database for the app to perform an offline mode.(By swift)
So everything works fine but when i builded it on my real Iphone it seems like the database didn't go along with the app and then my app was crashed.
How can i fix it?
Thanks!
Most probably your app is running under an assumption that that data will always be present, but this is not the case. Both the instances are different, the one on simulator and the one on real device. So remove that assumption from your code. And make sure you setup the records in the real device also to make sure that you read successfully.

how to make iPhone app crash after launch? [duplicate]

This question already has answers here:
What's a reliable way to make an iOS app crash?
(18 answers)
Closed 8 years ago.
What is the code on Xcode and where do I put it to make an iOS app crash?
I want to make my app launch a url and then crash. Is there any way to do this?
Thanks
This sounds like a terrible idea, but if you insist you can just call a method that doesn't exist to force a crash, e.g.
[self performSelector:#selector(doesntExist:)];
Or you can close the App like this:
exit(0);
But you really shouldn't do this, neither of these methods are acceptable for the App Store (or anything for that matter!)
If you just want to crash (in order to see how your app recovers from a crash), simply do something stupid like [nameOfArray objectAtIndex:100000000];

Resources