首页 \ 问答 \ 接口成员是抽象的吗?(Are interface members abstract?)

接口成员是抽象的吗?(Are interface members abstract?)

我知道界面中的成员就像抽象一样,但实际上它们是抽象的吗? 我的意思是我不需要使用该关键字,所以我不确定它是隐含的还是它们在技术上不是抽象的......希望它有意义


Well I know members in an interface act like they were abstract, but are they abstract actually? I mean that I do not need to use that keyword so I am not sure whether its implicit or they are not abstract technically...Hope it makes sense


原文:https://stackoverflow.com/questions/5653568
更新时间:2022-04-14 17:04

最满意答案

你们的关系应该都是反向的(在这种情况下,彼此相反)。 这允许Core Data正确管理关系,并允许您在两个方向导航时方便地设置它。 它也恰当地代表了这种关系。

谓词应该是:

NSPredicate *p = [NSPredicate predicateWithFormat:@"camera == %@", self.selectedCamera];

Roll实体上使用camera关系并检查它是否包含提供的self.selectedCamera实体实例。


Your relationships should each have an inverse (in this case, be inverse of each other). This allows Core Data to properly manage the relationship and allows you to set it conveniently while navigating it in both directions. It also properly represents the relationship.

The predicate should be:

NSPredicate *p = [NSPredicate predicateWithFormat:@"camera == %@", self.selectedCamera];

to use the camera relationship on the Roll entity and check that it contains the provided self.selectedCamera entity instance.

相关问答

更多
  • 你将不得不使用类似的参考 (refGroupTableName.groupId IN %@"),SendGrupList you will have to use refrences like (refGroupTableName.groupId IN %@"),SendGrupList
  • 点符号与它无关,如果你调用[tempGCS setEye:...] ,你会得到同样的错误。 错误在于你忽略了调用initWithEntity:insertIntoManagedObjectContext:在tempGCS创建对象时; 特别是[[GCS alloc] init]将无法正常工作。 Dot notation has nothing to do with it, you'd get the same error if you called [tempGCS setEye:...]. The erro ...
  • 你可以在你的实体上创建一个新的方法,我们称之为monthOfDate 。 此方法只是使用[self dateAttribute]和NSDateComponents来提取日期的月份。 然后你可以编写一个谓词: //assuming 1-based month indexing NSPredicate * julyEntities = [NSPredicate predicateWithFormat:@"monthOfDate = 7"]; 这里的技巧是意识到谓词的左键路径将导致方法调用。 因此,如果将左侧 ...
  • 这是你想要的? NSString *name = @"Scott Olsen"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name = %@", name]; NSSet *filtered = [sports.persons filteredSetUsingPredicate:predicate]; 或者(我发布上述代码后您的问题发生了变化): NSString *name = @"Scott Olsen"; NSStrin ...
  • 您只需将选定的WorkoutExercise •exercise传递给下一个视图控制器,因为可以从那里访问其他数据 WorkoutDay *day = exercise.workoutDay; WorkoutSet *set = day.workoutSet; WorkoutType *type = set.workoutType; 使用反向关系。 You need only to pass the selected WorkoutExercise •exercise to the next view c ...
  • 实际上,这竟然是我的错 - 我在谓词中为该对象使用了一个不存在的属性。 “MyEntity”不包含“pageId” - 但更好的错误信息不会出错。 Actually this turned out to be my fault - I was using a non-existent property for that object in the predicate. "MyEntity" did not contain a "pageId" - a better error message would n ...
  • 只需覆盖托管对象子类中的validateForInsert和validateForUpdate ,即可实现属性间验证,如此处的文档所示(带代码示例)。 可以通过丰富的托管对象API实现“基于谓词”的验证。 每个NSManagedObject都有一个关联的NSEntityDescription (一个名为entity的属性)。 通过此,您可以NSPropertyDescription每个属性的NSPropertyDescription 。 属性描述又有一个名为validationPredicates的属性,这 ...
  • 你们的关系应该都是反向的(在这种情况下,彼此相反)。 这允许Core Data正确管理关系,并允许您在两个方向导航时方便地设置它。 它也恰当地代表了这种关系。 谓词应该是: NSPredicate *p = [NSPredicate predicateWithFormat:@"camera == %@", self.selectedCamera]; 在Roll实体上使用camera关系并检查它是否包含提供的self.selectedCamera实体实例。 Your relationships should ...
  • 这看起来很像你的变量startDate和endDate会包含意外的值。 startDate来自没有一天等的日期组件,以及来自startDate的endDate 。 因此,我建议在断言定义之前放置断点或NSLog语句,以便检查这些值。 此外,目前尚不清楚您正在使用的NSCalendar 。 从文档 : 日,周,工作日,月和年数通常是基于1的,但可能存在特定于日历的例外。 因此,似乎将例如将day属性设置为0可能会有问题。 This looks a lot like your like your variabl ...
  • 我认为这是一个需要SUBQUERY表达式的情况: [NSPredicate predicateWithFormat:@"SUBQUERY(sessions, $s, $s.date BETWEEN {$STARTDATE, $ENDDATE}).@count > 0"]; I think this is a case where you need a SUBQUERY expression: [NSPredicate predicateWithFormat:@"SUBQUERY(sessions, $s, ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。