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

Commit

Permalink
Fix botched merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Bodin committed May 18, 2009
1 parent 109c5ed commit aff6ed5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
13 changes: 13 additions & 0 deletions src/NSDateAdditions.m
@@ -0,0 +1,13 @@
#import "Three20/TTGlobal.h"

///////////////////////////////////////////////////////////////////////////////////////////////////

@implementation NSDate (TTCategory)

+ (id)dateWithToday {
NSString* format = @"%Y-%m-%d 00:00:00 +0700";
NSString* time = [[NSDate date] descriptionWithCalendarFormat:format timeZone:nil locale:nil];
return [self dateWithString:time];
}

@end
23 changes: 0 additions & 23 deletions src/NSStringAdditions.m
Expand Up @@ -15,29 +15,6 @@ - (BOOL)isWhitespace {
return YES;
}

- (BOOL)beginsWithString:(NSString*)substring {
if (self.length < substring.length) {
return NO;
} else {
NSRange searchRange = NSMakeRange(0, substring.length);
NSRange range = [self rangeOfString:substring options:0 range:searchRange];
return range.location == searchRange.location;
}
}

- (BOOL)endsWithString:(NSString*)substring {
if (self.length < substring.length) {
return NO;
} else {
NSRange searchRange = NSMakeRange(self.length - substring.length, substring.length);
NSRange range = [self rangeOfString:substring options:0 range:searchRange];
return range.location == searchRange.location;
}

NSRange range = [self rangeOfString:substring];
return range.location == self.length - substring.length;
}

// Copied and pasted from http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg28175.html
- (NSDictionary*)queryDictionaryUsingEncoding: (NSStringEncoding)encoding {
NSCharacterSet* delimiterSet = [NSCharacterSet characterSetWithCharactersInString:@"&;"];
Expand Down
8 changes: 8 additions & 0 deletions src/Three20/NSDateAdditions.h
@@ -0,0 +1,8 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSDate (TTCategory)

+ (id)dateWithToday;

@end
10 changes: 10 additions & 0 deletions src/Three20/NSStringAdditions.h
@@ -0,0 +1,10 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (TTCategory)

- (BOOL)isWhitespace;

- (NSDictionary*)queryDictionaryUsingEncoding: (NSStringEncoding)encoding;

@end

0 comments on commit aff6ed5

Please sign in to comment.