IPAD G5解谜游戏THE LAIR2龙岭传说2卡住了
玩到很后面出来在巨人守卫喝酒那里,提示点酒瓶,但没反映,该怎么过?谢谢,相信你们也有人在这卡住
更新时间:2023-08-03 12:08
最满意答案
您需要使用
ViewModel
。 这基本上是一个类,用于将视图所需的各种模型的所有部分组合在一起。它可能看起来像:
public class CategoryListingsVieWModel { public IList<ISubCategory> Subcategories{get;set;} public IList<ICategory> Categories{get;set;} [...] // Any other data your view needs }
然后,这将成为您从控制器传递的视图模型。
You need to use a
ViewModel
. This is basically a class that you use to bring together all the pieces of the various models required for your view.It might look something like:
public class CategoryListingsVieWModel { public IList<ISubCategory> Subcategories{get;set;} public IList<ICategory> Categories{get;set;} [...] // Any other data your view needs }
This then becomes the model for your view which your pass from your controller.
相关问答
更多-
如何在我的视图中访问多个模型/控制器的数据?(How do i access data from multiple models/controllers in my view?)[2023-01-29]
您需要使用ViewModel 。 这基本上是一个类,用于将视图所需的各种模型的所有部分组合在一起。 它可能看起来像: public class CategoryListingsVieWModel { public IListSubcategories{get;set;} public IList Categories{get;set;} [...] // Any other data your view needs } 然后,这将成为您 ... -
查看控制器和多个视图(View Controllers and Multiple Views)[2023-05-22]
不,您可以使用单个UIViewController和/或UITableView(取决于您希望如何呈现数据),只需根据Segmented Control选项更改dataSource 。 有关更多信息,请查看UITableViewDataSource 。 在Table View的情况下,dataSource只是一些数据的数组。 除了Table View / Collection View之外的另一种方法是将Container View放在UIViewController中,它只使用一个UIViewControl ... -
Singleton模式将帮助您。 当您需要只有一个实例的类时,Singleton正在使用,您需要提供对该实例的全局访问点。 查看更多:应用于ASP.Net MVC应用程序的单例模式示例: 如何在c#中创建一个完美的Singleton类? http://www.alexzaitzev.pro/2013/02/singleton-pattern.html The Singleton pattern will help you. Singleton is using when you need a class t ...
-
毕竟我找到了解决方法。 在视图中,我调用我的模型,如下所示 $model = $this->getModel('mymodel'); $data = $model->my_method($args); 比我创建一个保存布局数据的公共变量 $this->data = $data; After all I found out the workaround. In the view I call my model as it follows $model = $this->getModel('mymodel ...
-
假设你正在使用Storyboard进行布局,我已经在下面编写了一个可能的解决方案。 基本上,您保持aScore和cScore的运行总数,并使用prepareForSegue将运行总数传递给下一个视图控制器的aScore和cScore变量。 我创建了一个名为proceedToNextLevel的函数,只要您想进入下一个级别,就会调用它。 你的1级视图控制器看起来像这样: class Level1ViewController: UIViewController { var cScore ...
-
控制器可以使用许多型号。 但是一个视图只能传入一个模型,称为ViewModel。 所以也许你可以说,1输出ViewModel Per ActionResult,但正如你在动作结果中提到的那样,你可以使用4个很多模型,结果将归结为输出视图模型 转到部分视图的模型可能与父视图的模型或父视图模型的子对象完全相同。 A controller may use MANY models. yet a view can have only 1 model passed into it which is called Vie ...
-
public class StudentPersonalInfo { public string StudentFirstName { get; set; } public string StudentLastName { get; set; } public int Age { get; set; } public string BloodGroup { get; set; } public string Address { get; set; ...
-
我理解ApplicationDelegate对象是管理我的应用程序全局数据的最佳位置,对吗? 不是真的(你的大学教授有一点意见)。 开始在应用代表中添加大量内容很诱人,但这不是一种非常可持续的做法。 在这里看到我的答案 。 并阅读Matt Gallagher的这篇好文章以获得更多深度。 也就是说,我经常在我的app delegate标题中添加这样的内容: #define APP_DELEGATE (MyAppDelegate*) [[UIApplication sharedApplication] dele ...
-
在设计接口时,最大限度地减少对象依赖项的数量和持续时间是一个很好的原则。 这应该可以帮助您限制每个对象的职责,并使它们更容易测试,并在需要时重构为更小的组件。 避免单例也支持一组结构良好的对象(单个实例当然是许多应用程序的现实,但这并不意味着它们需要使用Singleton模式强制执行或访问)。 避免单例有助于避免类和全局状态之间隐藏的紧密耦合,这两者都会导致难以测试,理解和重用的类。 con是它在从属视图控制器和根视图控制器之间添加依赖关系。 需要引用这些模型对象的视图控制器需要通过根视图控制器获取引用。 ...
-
laravel 4 - 将多个控制器中的类似数据拉入多个视图中(laravel 4 - pull similar data in multiple controllers into many views)[2022-04-02]
使用视图编辑器自动使用数据填充视图: 首先为像user/13或user/15这样的任何URI创建一个路由模式(在routes.php文件中): // Composers will be used only for this url pattern, i.e. "user/13" or "user/15" Route::when('user/*', 'prepareView'); 然后像这样创建prepareView过滤器: Route::filter('prepareView', function($ro ...