Password protecting button in ipad application

This is a strange requirement. I am developing an application where there is a button, and after clicking on it you will be taken to the configuration screen. This should be used only by administrators. Can this button be password protected? If so, some sample code will help.

Let me know if you need more details.
-Pradeep

+3
source share
2 answers

I do not know if there is another easy way to do this. So here is my solution.
You can check the weather that the user is an administrator or not in the code at the time viewDidLoad, and then make the button hidden if the user is not an administrator.

PS. IBOutlet .

+3

, . , () .

- (IBAction)proceedToFirstWindow:(id)sender {

[window2 makeKeyAndOrderFront:self];


}

- (IBAction)proceedToSecondWindow:(id)sender {


if ([[secureField stringValue]isEqualToString:@"hello"]) {

    [window orderOut:self];

    [window2 orderOut:self];

    [window3 makeKeyAndOrderFront:self];

}
else {
    return;
}
}

, . "" NSSecureTextField, , , . , ipad, , - ? , !

+2

Source: https://habr.com/ru/post/1796473/


All Articles