我有一个VC RaceDayChecklistViewController.m,它是RaceDayChecklistViewControllerBase.m的子类.
在RaceDayChecklistVC.m中,添加了一个被调用两次的目标操作.nextOrNewButton是点击的按钮,我想调用"demo"动作.另外,checklistnavigationItem是栏按钮项.
- (void)viewDidLoad
{
checklistTableViewBase=checklistTableView;
checklistNavigationItemBase=checklistnavigationItem;
nextOrNewButtonBase=nextOrNewButton;
[nextOrNewButton addTarget:self action:@selector(demo) forControlEvents:UIControlEventAllEvents];
}
-(void) demo
{
RaceDayDataController *sharedController = [RaceDayDataController sharedDataController];
if (sharedController.isSubmited)
{
[self.checklistnavigationItem setTitle:@"New"]; //
}
else
{
[self.checklistnavigationItem setTitle:@"Next"];
[self showAlert];
}
}
-(void) viewWillDisappear:(BOOL)animated
{
[nextOrNewButton removeTarget:self action: @selector(demo) forControlEvents:UIControlEventAllEvents];
}
Run Code Online (Sandbox Code Playgroud)
可能是多次调用动作演示的原因是什么?它是基类负责人吗?
请指导.
刚开始使用MVC,我遇到了问题.以下是我的文件的层次结构:
1.WebJltNZ\JWebJltNZ.Presentation.Web.Mvc\Controllers : LbpProfessionalController
2.WebJltNZ.Presentation.Web.Mvc\ViewModels : LbpProfessional
3.WebJltNZ.Presentation.Web.Mvc\Views\Home\RiskAndInsuranceServices\JltAffinityPartnerships :LbpProfessionalProtectionApplication
Run Code Online (Sandbox Code Playgroud)
方法如下:
public ActionResult Index()
{
return View(); // it's cannot be found.
}
Run Code Online (Sandbox Code Playgroud)
无法找到该视图.
我在这里错过了一些东西.请帮忙.