草庐IT

keypaths

全部标签

javascript - 在 IE 10/11 中使用数组作为 indexedDB keyPaths

我有一个数组作为我使用indexedDB的键路径,它在Chrome和Firefox上运行良好,但是当我尝试使用IE添加/放置时,它给我一个DataError。varrequest=window.indexedDB.open("MyTestDatabase");request.onsuccess=function(event){vardatabase=event.target.result;vartransaction=database.transaction(["document"],"readwrite");varobjectStore=transaction.objectStore

ios - 没有找到与 RestKit 的可映射关系值 keyPath

我无法使用RestKit将我的JSON映射到核心数据。RK日志记录说:DidnotfindmappablerelationshipvaluekeyPath.我显然做错了什么。日志:2012-11-2015:40:36.525eMobile[44849:12603]Trestkit.object_mapping:RKObjectMappingOperation.m:342MappingattributevaluekeyPath'OBJECTCLASS'to'type'2012-11-2015:40:36.525eMobile[44849:12603]Trestkit.object_map

ios - "self"的 KVO keyPath

我正在尝试为NSStrings的NSArray创建一个sortDescriptor。我只是不确定要为key参数添加什么,因为我想使用“self”或类似的东西,因为我只想使用标准的NSString比较。在这段代码中...[NSSortDescriptorsortDescriptorWithKey:@"..."ascending:YES];我应该把什么放在...的位置?self? 最佳答案 self应该可以。您还可以使用description,在这种情况下,排序不仅适用于NSString,也适用于NSNumber。

ios - setPropertiesToFetch 返回 'Invalid keypath expression' 错误

我正在尝试以最基本的形式使用核心数据分组功能:-(NSFetchedResultsController*)fetchedResultsController{NSManagedObjectContext*managedObjectContext=[selfmanagedObjectContext];if(_fetchedResultsController!=nil){return_fetchedResultsController;}NSExpression*reviewNumKeyExpression=[NSExpressionexpressionForKeyPath:@"review_

ios - RestKit - 找不到 keyPath : '' 的对象映射

以下代码会产生此错误。-(void)viewDidLoad{RKObjectManager*manager=[RKObjectManagerobjectManagerWithBaseURLString:@"http://localhost:3000"];RKObjectMapping*contactMapping=[RKObjectMappingmappingForClass:[Contactclass]];[contactMappingmapKeyPathsToAttributes:@"nom",@"nom",@"prenom",@"prenom",@"telephone",@"te

使用``reference writable keypath''的Swift编译器分割故障'

用一个ReferenceWritaleKeyPath读取属性正在导致编译器分割故障。我正在设置一个助手来简化绑定两个变量。和Ooper的帮助我得到了工作的基本绑定,但是如果修改代码如下所示以检查值在执行绑定之前的值不同,则它具有分割故障。protocolBindable:class{varobservers:[NSKeyValueObservation]{getset}}extensionBindable{funcbind(totargetKeyPath:ReferenceWritableKeyPath,fromsourceKeyPath:KeyPath)whereSelf:NSObject{

ios - RestKit 映射字符串数组和同一对象的 keyPath 值

我已经找了几个小时的答案,我不知道该怎么做。我有一个需要映射的JSON,它有一个没有keyPath的字符串数组,还有一个需要映射的属性,它有一个keyPath。我使用的是RestKit0.21.0,当我更新到RestKit0.22.0时出现了同样的错误。JSON:{"content":{"site":"www.inf.ufsc.br/~fcdocil","modulos":["noticias","fotos","conteudo"]}}RKResponseDescriptor:RKEntityMapping*moduleMapping=[RKEntityMappingmappingF

ios - 使用 keyValueObservingExpectationForObject 时的 XCTest 异常 :keyPath:handler:

在我的单元测试中,我使用-[XCTestCasekeyValueObservingExpectationForObject:keyPath:handler:]方法来确保我的NSOperation完成,这里是codefrommyXCDYouTubeKitproject:-(void)testStartingOnBackgroundThread{XCDYouTubeVideoOperation*operation=[[XCDYouTubeVideoOperationalloc]initWithVideoIdentifier:nillanguageIdentifier:nil];[selfk

ios - 使用 Swift 3 #keyPath 引用 UIView 子类 .center

在我的应用程序的ViewController中,我通过观察其center属性的键值对View定位的更改使用react,如下所示:classCoordinatingViewController:UIViewController{@IBOutletweakvarcardContainerView:CardView!overridefuncviewDidLoad(){super.viewDidLoad()addObserver(self,forKeyPath:"cardContainerView.center",options:[.new],context:nil)}}这目前工作得很好,但由

ios - 核心数据错误 SIGABRT : keypath AttributeName not found in entity <NSSQLEntity EntityName id=2>

我在我的iOS应用程序中使用核心数据。我有两个实体“Commit”,属性为“commitID”、“completionStatus”、“contents”和“repeatStatus”,还有一个实体“ToDoList”,属性为“dateID”。两者通过一种关系将许多提交关联到一个ToDoList。我每次都会收到以下错误。我试过删除并重新安装该应用程序,但无济于事。我知道这个错误是在我的application(application:didFinishLaunchingWithOptions:)方法之后抛出的:2016-05-0710:54:14.131CommitToday[1836: