Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Numerous reverts.
Browse files Browse the repository at this point in the history
Revert 3189850.
Revert 4e92b36.
Revert a24c75f.
Revert cac29ca.
Revert aeaa06a.
  • Loading branch information
jverkoey committed Feb 26, 2011
1 parent 1ef027d commit 5b6e5c9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/Three20Core/Headers/NSStringAdditions.h
Expand Up @@ -30,7 +30,7 @@

/**
* Determines if the string is empty or contains only whitespace.
* @deprecated Use TTIsStringWithAnyText() instead.
* @deprecated Use TTIsStringWithAnyText: instead.
*/
- (BOOL)isEmptyOrWhitespace __TTDEPRECATED_METHOD;

Expand Down
2 changes: 1 addition & 1 deletion src/Three20UI/Sources/TTLauncherButton.m
Expand Up @@ -112,7 +112,7 @@ - (void)updateBadge {
}

if (_item.badgeNumber > 0) {
if (_item.badgeNumber <= kMaxBadgeNumber) {
if (_item.badgeNumber <= kMaxBadgeNumber) {
_badge.text = [NSString stringWithFormat:@"%d", _item.badgeNumber];

} else {
Expand Down
13 changes: 4 additions & 9 deletions src/Three20UI/Sources/TTMessageController.m
Expand Up @@ -43,7 +43,6 @@
#import "Three20Core/TTGlobalCoreLocale.h"
#import "Three20Core/TTGlobalCoreRects.h"
#import "Three20Core/NSStringAdditions.h"
#import "Three20Core/TTGlobalCore.h"


///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -190,8 +189,7 @@ - (BOOL)hasEnteredText {

} else if ([field isKindOfClass:[TTMessageTextField class]]) {
UITextField* textField = [_fieldViews objectAtIndex:i];
if (TTIsStringWithAnyText(textField.text)
&& !textField.text.isWhitespaceAndNewlines) {
if (!textField.text.isEmptyOrWhitespace) {
return YES;
}
}
Expand Down Expand Up @@ -219,7 +217,7 @@ - (BOOL)hasRequiredText {

} else if ([field isKindOfClass:[TTMessageTextField class]]) {
UITextField* textField = [_fieldViews objectAtIndex:i];
if (0 == textField.text.length || textField.text.isWhitespaceAndNewlines) {
if (textField.text.isEmptyOrWhitespace) {
return NO;
}
}
Expand Down Expand Up @@ -660,13 +658,10 @@ - (BOOL)fieldHasValueAtIndex:(NSUInteger)fieldIndex {
TTMessageField* field = [_fields objectAtIndex:fieldIndex];
if ([field isKindOfClass:[TTMessageRecipientField class]]) {
TTPickerTextField* pickerTextField = [_fieldViews objectAtIndex:fieldIndex];
return (TTIsStringWithAnyText(pickerTextField.text)
&& !pickerTextField.text.isWhitespaceAndNewlines)
|| pickerTextField.cellViews.count > 0;
return !pickerTextField.text.isEmptyOrWhitespace || pickerTextField.cellViews.count > 0;
} else {
UITextField* textField = [_fieldViews objectAtIndex:fieldIndex];
return (TTIsStringWithAnyText(textField.text)
&& !textField.text.isWhitespaceAndNewlines);
return !textField.text.isEmptyOrWhitespace;
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/Three20UI/Sources/TTPostController.m
Expand Up @@ -38,7 +38,7 @@
#import "Three20Core/TTGlobalCoreLocale.h"
#import "Three20Core/TTCorePreprocessorMacros.h"
#import "Three20Core/NSStringAdditions.h"
#import "Three20Core/TTGlobalCore.h"

static const CGFloat kMarginX = 5;
static const CGFloat kMarginY = 6;

Expand Down Expand Up @@ -506,8 +506,7 @@ - (void)post {

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)cancel {
if (!TTIsStringWithAnyText(_textView.text)
&& !_textView.text.isWhitespaceAndNewlines
if (!_textView.text.isEmptyOrWhitespace
&& !(_defaultText && [_defaultText isEqualToString:_textView.text])) {
UIAlertView* cancelAlertView = [[[UIAlertView alloc] initWithTitle:
TTLocalizedString(@"Cancel", @"")
Expand Down
7 changes: 1 addition & 6 deletions src/Three20UI/Sources/TTTableViewDelegate.m
Expand Up @@ -92,12 +92,7 @@ - (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)
NSString* title = [tableView.dataSource tableView:tableView titleForHeaderInSection:section];
if (title.length > 0) {
TTTableHeaderView* header = [_headers objectForKey:title];
// If retrieved from cache, prepare for reuse:
// We reset the the opacity to 1, UITableView could set this property to 0 after remove it.
if (header) {
header.alpha = 1;
}
else if (nil == header) {
if (nil == header) {
if (nil == _headers) {
_headers = [[NSMutableDictionary alloc] init];
}
Expand Down
4 changes: 1 addition & 3 deletions src/Three20UI/Sources/TTTextBarController.m
Expand Up @@ -39,7 +39,6 @@
#import "Three20Core/TTGlobalCoreLocale.h"
#import "Three20Core/TTCorePreprocessorMacros.h"
#import "Three20Core/NSStringAdditions.h"
#import "Three20Core/TTGlobalCore.h"

static CGFloat kMargin = 1;
static CGFloat kPadding = 5;
Expand Down Expand Up @@ -411,8 +410,7 @@ - (void)post {

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)cancel {
if (!TTIsStringWithAnyText(_textEditor.text)
&& !_textEditor.text.isWhitespaceAndNewlines
if (!_textEditor.text.isEmptyOrWhitespace
&& !(_defaultText && [_defaultText isEqualToString:_textEditor.text])) {
UIAlertView* cancelAlertView = [[[UIAlertView alloc] initWithTitle:
TTLocalizedString(@"Cancel", @"")
Expand Down

0 comments on commit 5b6e5c9

Please sign in to comment.