iphone - how to disable UIMenuControll (cut,copy,paste,select all,delete) in UIviewController subclass? -


i have implemented many methods paste doesn't hide. using xcode version 4.5.2

-(bool)canperformaction:(sel)action withsender:(id)sender {     uimenucontroller *menucontroller = [uimenucontroller sharedmenucontroller];     if (menucontroller) {         [uimenucontroller sharedmenucontroller].menuvisible = no;      }     return no;   } 

every method seems fail working me. can me on this? in advance

you need these things enable/disable uimenucontroller items.

  1. to show/hide uimenucontroller items, view or view controller needs implement canbecomefirstresponder(returning yes/no show/hide).

  2. you can implement canperformaction:withsender: method of uiresponder disable or enable user-interface commands {copy, select, select all, paste , etc} based on context.

  3. or can override update method of uimenucontroller handle custom behavior of individual item. example, if pasteboard holds no data of compatible type, paste command disabled. may either force show/hide paste menu item overriding method.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -