huinme / YAPCViewer

Viewer app for YAPC Asia 2013
17 stars 3 forks source link

検索時に名前とabstractでも引っ掛けるようにする #10

Closed monmon closed 11 years ago

monmon commented 11 years ago

そんな大事ではなくのでこのくらいの対応で良さそう

diff --git a/YAPCViewer/Classes/ViewControlleres/YVTalkListViewController.m b/YAPCViewer/Classes/ViewControlleres/YVTalkListViewController.m
index 8fc6f6f..7bc929f 100644
--- a/YAPCViewer/Classes/ViewControlleres/YVTalkListViewController.m
+++ b/YAPCViewer/Classes/ViewControlleres/YVTalkListViewController.m
@@ -171,8 +171,8 @@ static NSString *const kYVTalkListThirdDateString   = @"2013-09-21";

     NSArray *items = [self.frController fetchedObjects];

-    NSString *predicateString = @"title contains[cd] %@ OR title_en contains[cd] %@";
-    NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString, query, query];
+    NSString *predicateString = @"title contains[cd] %@ OR title_en contains[cd] %@ OR speaker.name contains[cd] %@ OR abstract.abstract contains[cd] %@";
+    NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString, query, query, query, query];
     items = [items filteredArrayUsingPredicate:predicate];

     return items;