当我在UIToolBar上单击完成按钮时,我想调出"TableViewController"的.nib.但下面不允许点击显示新视图.我该如何纠正这个?请告诉我哪里出错了,应该更换什么以及为什么.
//Here's the selector in my overlay.
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed)];
//Here's how I made my action. Btw, the uitoolbar has no nib, it's an overlay on the
//(camera mode).
-(void)doneButtonPressed {
TableViewController *tableView = [[TableViewController alloc]
initWithNibName:@"TableViewController" bundle:nil];
tableView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:tableView animated:YES];
}
//Yet nothing happens when I click on my done button on my overlay. And I've made sure
// i've imported .h frameworks correctly too.
Run Code Online (Sandbox Code Playgroud)
假设你要从一个位于UI工具栏上的barbuttonitem中调出一个笔尖.你会怎么做?
我被告知要使其正常运行,我必须添加[barButtonItem addTarget:self action:@selector(doneButtonPressed)forControlEvents:UIControlEventTouchUpInside]; . …
我在笔尖中有一个名为printscreen的按钮.在我的.m文件中,我有 - (IBAction)printscreen {}.
应该在{}之间进行什么操作,以便在我单击按钮时打印屏幕截图.我不希望图像保存,我不希望它去文件和所有废话.我想点击按钮,一旦我点击它,它应该打印当前屏幕上的任何内容.
我已经完成了所有问题,没有一个非常有用.我只是在这里寻找代码.请帮忙.