I have a login page in my application with two users-Administrator and Standard. On successful login, we get to the welcome page, where a pop up button is present. I want to disable the 3rd and the 4th menu items in the pop up button menu for the standard user.
For Administrator, all the menu items should be available.
I want this distinction based on the user’s selection on the login page.
Please help me, how i can achieve this?
Do i have to use KVC concepts? If yes, how?
Thanks in advance..
You need to do two things here.
To disable your third and fourth menu items, you need to set their
enabledproperty toNO.Set
autoenablesItemsproperty ofNSPopUpButtontoNO.If you don’t set this, the menu items will be automatically enabled when you click the pop up button, even though you disable them using Step 1.
Do these things in the
-(void)awakeFromNibmethod.For storing the login data to a persistent storage, you can use
NSUserDefaults. For example.Here,
UserTypeis a user defined Key. You can define any key you want.