简体   繁体   中英

Tell Cocoa App to quit if incorrect login

I want to quit my cocoa app if a user tries to enter an incorrect passcode or tries to cancel the login process.

Is it ok to use this:

[NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.0];

or is there something else preferred?

On a Macintosh, it's okay to self terminate as long as the user clearly understands why the app is quitting.

On an iOS device, it would be better to leave the user stuck at the login screen and throw up "wrong password" alerts. Apple tends to frown on self-terminating apps on the iPhone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM