diff --git a/Humanity/Humanity.xcodeproj/project.pbxproj b/Humanity/Humanity.xcodeproj/project.pbxproj index 6e512a9..ed35004 100644 --- a/Humanity/Humanity.xcodeproj/project.pbxproj +++ b/Humanity/Humanity.xcodeproj/project.pbxproj @@ -37,7 +37,6 @@ 6626A1271465E3470019AA25 /* NSData+JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A1251465E3470019AA25 /* NSData+JSONKit.m */; }; 6626A12B1465E46B0019AA25 /* ABMultiValueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A12A1465E46B0019AA25 /* ABMultiValueAdditions.m */; }; 6626A12E1465E5280019AA25 /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A12D1465E5280019AA25 /* NSStringAdditions.m */; }; - 6626A1311465E8210019AA25 /* SCSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A1301465E8210019AA25 /* SCSearchBar.m */; }; 6626A1341465E8CA0019AA25 /* UIScreenAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A1331465E8CA0019AA25 /* UIScreenAdditions.m */; }; 6626A1371465E9530019AA25 /* SCTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A1361465E9530019AA25 /* SCTableViewController.m */; }; 6626A13D1465F0860019AA25 /* UITableViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6626A13C1465F0860019AA25 /* UITableViewAdditions.m */; }; @@ -150,8 +149,6 @@ 6626A12A1465E46B0019AA25 /* ABMultiValueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ABMultiValueAdditions.m; path = AddressBook/ABMultiValueAdditions.m; sourceTree = ""; }; 6626A12C1465E5280019AA25 /* NSStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSStringAdditions.h; path = AddressBook/NSStringAdditions.h; sourceTree = ""; }; 6626A12D1465E5280019AA25 /* NSStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSStringAdditions.m; path = AddressBook/NSStringAdditions.m; sourceTree = ""; }; - 6626A12F1465E8210019AA25 /* SCSearchBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSearchBar.h; sourceTree = ""; }; - 6626A1301465E8210019AA25 /* SCSearchBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCSearchBar.m; sourceTree = ""; }; 6626A1321465E8CA0019AA25 /* UIScreenAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScreenAdditions.h; path = AddressBook/UIScreenAdditions.h; sourceTree = ""; }; 6626A1331465E8CA0019AA25 /* UIScreenAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UIScreenAdditions.m; path = AddressBook/UIScreenAdditions.m; sourceTree = ""; }; 6626A1351465E9530019AA25 /* SCTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SCTableViewController.h; path = AddressBook/SCTableViewController.h; sourceTree = ""; }; @@ -623,8 +620,6 @@ children = ( 49BC8720146659A700EF87BB /* Profile Screen */, 49BC86FC14660C6800EF87BB /* Settings Screen */, - 6626A12F1465E8210019AA25 /* SCSearchBar.h */, - 6626A1301465E8210019AA25 /* SCSearchBar.m */, 66A105951466294800E5FC75 /* Account Manager */, 6668555B1465DCAB0023B5DE /* SCReachability.h */, 6668555C1465DCAB0023B5DE /* SCReachability.m */, @@ -837,7 +832,6 @@ 6626A1271465E3470019AA25 /* NSData+JSONKit.m in Sources */, 6626A12B1465E46B0019AA25 /* ABMultiValueAdditions.m in Sources */, 6626A12E1465E5280019AA25 /* NSStringAdditions.m in Sources */, - 6626A1311465E8210019AA25 /* SCSearchBar.m in Sources */, 6626A1341465E8CA0019AA25 /* UIScreenAdditions.m in Sources */, 6626A1371465E9530019AA25 /* SCTableViewController.m in Sources */, 6626A13D1465F0860019AA25 /* UITableViewAdditions.m in Sources */, diff --git a/Humanity/Humanity/AddressBook/NSStringAdditions.h b/Humanity/Humanity/AddressBook/NSStringAdditions.h index 1695aec..6f25b81 100644 --- a/Humanity/Humanity/AddressBook/NSStringAdditions.h +++ b/Humanity/Humanity/AddressBook/NSStringAdditions.h @@ -4,11 +4,6 @@ - (BOOL) hasCaseInsensitivePrefix:(NSString *) prefix; - (BOOL) hasCaseInsensitiveSuffix:(NSString *) suffix; -- (NSString *) stringByRemovingCharactersInSet:(NSCharacterSet *) set; - (NSString *) stringByCapitalizingString; - -- (NSString *) stringByEncodingToPercentEscapeString; - -- (NSString *) stringByDecodingFromPercentEscapeString; @end diff --git a/Humanity/Humanity/AddressBook/NSStringAdditions.m b/Humanity/Humanity/AddressBook/NSStringAdditions.m index 8a2c73c..3c3b387 100644 --- a/Humanity/Humanity/AddressBook/NSStringAdditions.m +++ b/Humanity/Humanity/AddressBook/NSStringAdditions.m @@ -23,33 +23,6 @@ - (BOOL) hasCaseInsensitiveSuffix:(NSString *) suffix { return [self _hasCaseInsensitiveSearchInString:suffix options:NSBackwardsSearch]; } -#pragma mark - - -- (NSString *) stringByRemovingCharactersInSet:(NSCharacterSet *) set { - NSMutableString *mutableSelf = [self mutableCopy]; - NSUInteger length = self.length; - - for (NSUInteger i = 0; i < length; i++) { - if ([set characterIsMember:[mutableSelf characterAtIndex:i]]) { - [mutableSelf deleteCharactersInRange:NSMakeRange(i, 1)]; - length--; i--; - } - } - - return [mutableSelf autorelease]; -} - -- (NSString *) stringByEncodingToPercentEscapeString { - CFStringRef percentEncodedString = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingUTF8); - return [(NSString *)percentEncodedString autorelease]; -} - -- (NSString *) stringByDecodingFromPercentEscapeString { - CFStringRef percentDecodedString = CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)self, (CFStringRef)@""); - return [(NSString *)percentDecodedString autorelease]; -} - - - (NSString *) stringByCapitalizingString { if (!self.length) return @""; diff --git a/Humanity/Humanity/AddressBook/SCTableViewController.h b/Humanity/Humanity/AddressBook/SCTableViewController.h index 1938c19..b16d16a 100644 --- a/Humanity/Humanity/AddressBook/SCTableViewController.h +++ b/Humanity/Humanity/AddressBook/SCTableViewController.h @@ -1,5 +1,3 @@ -@class SCSearchBar; - typedef enum { SCAlternateViewPositionNone, SCAlternateViewPositionTop, @@ -21,7 +19,6 @@ typedef enum { BOOL _showsSearchBar; BOOL _searchImmediately; - SCSearchBar *_searchBar; BOOL _unloaded; BOOL _hasTabbar; @@ -34,7 +31,6 @@ typedef enum { @property (nonatomic, assign) BOOL showsSearchBar; @property (nonatomic, assign) BOOL searchImmediately; -@property (nonatomic, readonly) SCSearchBar *searchBar; @property (nonatomic, assign) BOOL hasTabbar; - (id) initWithStyle:(UITableViewStyle) style position:(SCAlternateViewPosition) position; diff --git a/Humanity/Humanity/AddressBook/SCTableViewController.m b/Humanity/Humanity/AddressBook/SCTableViewController.m index dfcc8f1..a589d41 100644 --- a/Humanity/Humanity/AddressBook/SCTableViewController.m +++ b/Humanity/Humanity/AddressBook/SCTableViewController.m @@ -1,7 +1,5 @@ #import "SCTableViewController.h" -#import "SCSearchBar.h" - #import "UIScreenAdditions.h" #import "UITableViewAdditions.h" @@ -13,7 +11,6 @@ @implementation SCTableViewController @synthesize showsSearchBar = _showsSearchBar; @synthesize searchImmediately = _searchImmediately; -@synthesize searchBar = _searchBar; @synthesize hasTabbar = _hasTabbar; - (id) initWithStyle:(UITableViewStyle) style position:(SCAlternateViewPosition) position { if (!(self = [super init])) @@ -30,7 +27,6 @@ - (void) dealloc { if ([self isViewLoaded]) { _tableView.dataSource = nil; _tableView.delegate = nil; - _searchBar.delegate = nil; } [_tableView release]; @@ -62,8 +58,6 @@ - (void) loadView { _alternateViewHeight = height; //_alternateView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin); - NSLog(@"alternateViewYOrigin: %f", alternateViewYOrigin); - NSLog(@"height: %f", height); // Autoresizing is great once the initial size is set. but it still has to be set first. if (!_unloaded) { CGRect frame = _tableView.frame; @@ -73,10 +67,6 @@ - (void) loadView { _tableView.frame = frame; } - //if (_alternateViewPosition == SCAlternateViewPositionTop) - //_tableView.autoresizingMask |= UIViewAutoresizingFlexibleBottomMargin; - // else if (_alternateViewPosition == SCAlternateViewPositionBottom) - //_tableView.autoresizingMask |= UIViewAutoresizingFlexibleTopMargin; [view addSubview:_alternateView]; } diff --git a/Humanity/Humanity/SCSearchBar.h b/Humanity/Humanity/SCSearchBar.h deleted file mode 100644 index 9084133..0000000 --- a/Humanity/Humanity/SCSearchBar.h +++ /dev/null @@ -1,3 +0,0 @@ -@interface SCSearchBar : UISearchBar -- (void) resignForstResponderKeepCancel; -@end diff --git a/Humanity/Humanity/SCSearchBar.m b/Humanity/Humanity/SCSearchBar.m deleted file mode 100644 index b8e002c..0000000 --- a/Humanity/Humanity/SCSearchBar.m +++ /dev/null @@ -1,29 +0,0 @@ -#import "SCSearchBar.h" - -@implementation SCSearchBar -- (void) layoutSubviews { - for (UIView *subview in self.subviews) { - if ([subview isKindOfClass:[UITextField class]]) { - UITextField *textField = (UITextField *)subview; - - textField.keyboardAppearance = UIKeyboardAppearanceAlert; - } - } - [super layoutSubviews]; -} - -- (void) resignForstResponderKeepCancel { - for (UIView *subview in self.subviews) { - if ([subview isKindOfClass:[UITextField class]]) { - [subview resignFirstResponder]; - } - } - - for (UIView *subview in self.subviews) { - if ([subview isKindOfClass:[UIButton class]]) { - ((UIButton *)subview).enabled = YES; - } - } -} - -@end