English 中文(简体)
2个实体
原标题:Merge 2 screen with 2 entities

I had 4 UITableView which represents 4 tabs from my UITabBar. So I have an unique custom TableViewController which controls every screen depending on the entity (on CoreData) it has to display. In order to fetch elements from CoreData I use a NSFetchedResultsController.

但是,由于营销原因,我不得不合并2个屏幕,这意味着在同一屏幕上显示2个实体。 因此,我不得不从2个不同实体抽取一些内容。 我还有一个抽象的实体“要素”,即我用在我的表格“主计长”中,抽象地控制每个实体。

什么是最佳解决办法?

  • Do I have to rewrite my Model to merge those 2 entities (this is a problem because the 2 entities are a bit different)
  • Can I tell to my NSFetchedResultsController to fetch 2 entities ? How ?
  • Can I tell to my NSFetchedResultsController to fetch the Element entity and afterwards to predicate those Entities ? How ?

事先感谢你!

最佳回答

最后,我找到了我提出的解决办法。

我增加了一个新的《摘要》实体,这个实体是我想合并的2个孩子的超级阶级,但它也是一个“归属”的儿童。

因此,我的ElementListViewController仍然显示“要素”,我可以向合并的实体展示我的屏幕。

我现在致力于将旧模式移至新的模式。

愿这一职位有帮助一天......

问题回答

在这三个实体中,最好的解决办法是,将实体排在正确的上。 仅可查询一个实体。

我还将考虑一种满足您营销需求的不同做法。 你只能发挥两种不同的作用,而不是把结果结合起来。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签