Permalink
Browse files

Bug fix provided by jluckiv for search bar cancel after scrolling bug

  • Loading branch information...
1 parent a1ad7c6 commit 4265e5a27b111db6002c252bb5a1c2ecb282932e Erica Sadun committed Dec 1, 2009
Showing with 9 additions and 1 deletion.
  1. +9 −1 C19-CoreData/02-Queried Color List/main.m
@@ -102,7 +102,7 @@ - (void) initCoreData
if (needsBuilding)
{
NSString *pathname = [[NSBundle mainBundle] pathForResource:@"crayons" ofType:@"txt" inDirectory:@"/"];
- NSArray *crayons = [[NSString stringWithContentsOfFile:pathname] componentsSeparatedByString:@"\n"];
+ NSArray *crayons = [[NSString stringWithContentsOfFile:pathname encoding:NSUTF8StringEncoding error:nil] componentsSeparatedByString:@"\n"];
for (NSString *colorString in crayons) [self addColorToDB:colorString];
}
@@ -190,6 +190,14 @@ - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSS
}
#pragma mark Search Bar
+
+// Cancel button fix provided by jluckyiv.
+- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
+{
+ [self.searchBar setText:@""];
+ [self performFetch];
+}
+
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
[self performFetch];

0 comments on commit 4265e5a

Please sign in to comment.