是否有一个带有 MonoTouch 支持的 NSPredicate 的 NSFetchRequest
我已经使用 NSPredicate 尝试了以下操作,但没有得到我期望的结果:
NSFetchRequest request = new NSFetchRequest ();
request.Entity = NSEntityDescription.EntityForName("Entity", managedObjectContext);
NSSortDescriptor sort = new NSSortDescriptor ("date", false);
request.SortDescriptors = new NSSortDescriptor[1] { sort };
request.Predicate = NSPredicate.FromFormat("stringProperty == %@", new NSObject[1]{new NSString("someString")});
error = null;
NSObject[] results = managedObjectContext.ExecuteFetchRequest (request, out error);
当前稳定版本的 MonoTouch (5.0) 是否支持 NSPredicate 还是我做错了什么?
I have tried the following using an NSPredicate and am not getting the results I would expect:
NSFetchRequest request = new NSFetchRequest ();
request.Entity = NSEntityDescription.EntityForName("Entity", managedObjectContext);
NSSortDescriptor sort = new NSSortDescriptor ("date", false);
request.SortDescriptors = new NSSortDescriptor[1] { sort };
request.Predicate = NSPredicate.FromFormat("stringProperty == %@", new NSObject[1]{new NSString("someString")});
error = null;
NSObject[] results = managedObjectContext.ExecuteFetchRequest (request, out error);
Is NSPredicate supported in the current stable version of MonoTouch (5.0) or am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哇,你真的在这里节省了编程线。
很难用这个片段来判断,但是......
我最好的建议是将这些行分成更多行,例如
并继续逐行进行,以确保您获得正确的反馈。
这就是我所做的。可能有一点帮助
wow, You're really saving lines of programming here.
It is hard to tell with that snippet, but...
My best suggestion is to break those lines into more lines, like
And keep going like that line by line to make sure you're getting the right feedback.
That's what I do. Might help a little