在模拟器上,我看到 UIMenucontroller 没有问题,但它不会出现在运行 iOs 4+ 的设备上进行测试。它是使用 IB 添加的标准 uitextview。
我已将这些方法添加到作为委托的视图控制器中,但我认为它们不是必需的,因为我想要标准的菜单控制器、选择、复制等。更不用说它们没有被调用。
谢谢您的帮助
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
NSLog(@"Can perform action called");
BOOL answer = NO;
if (action == @selector(copy:))
{
answer = YES;
}
if (action == @selector(cut:))
{
answer = YES;
}
if (action == @selector(paste:))
{
answer = YES;
}
if (action == @selector(select:))
{
answer = YES;
}
if (action == @selector(selectAll:))
{
answer = YES;
}
return answer;
}
- (BOOL) canBecomeFirstResponder {
NSLog(@"can become first called");
return YES;
}