Anonymous avatar Anonymous committed 35ed4fd

* Various minor bug fixes

Comments (0)

Files changed (6)

src/NSDateAdditions.m

 @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];
+  NSString* format = @"%Y-%m-%d";
+  NSDateFormatter* formatter = [[[NSDateFormatter alloc] initWithDateFormat:format
+                                                         allowNaturalLanguage:NO] autorelease];
+  
+  NSString* time = [formatter stringFromDate:[NSDate date]];
+  return [formatter dateFromString:time];
 }
 
 @end

src/TTSearchTextField.m

         [superview addSubview:_shadowView];
       }
     }
+    
+    [_tableView deselectRowAtIndexPath:_tableView.indexPathForSelectedRow animated:NO];
   } else {
     UIView* parent = self.superview;
     if (parent) {

src/TTStyledFrame.m

 }
 
 - (TTStyledBoxFrame*)hitTest:(CGPoint)point {
-  if (CGRectContainsPoint(CGRectInset(_bounds, 0, -5), point)) {
+  if (CGRectContainsPoint(_bounds, point)) {
     TTStyledBoxFrame* frame = [_firstChildFrame hitTest:point];
     return frame ? frame : self;
   } else if (_nextFrame) {

src/TTThumbsTableViewCell.m

     
     _thumbView1.thumbURL = [_photo urlForVersion:TTPhotoVersionThumbnail];
     [self assignPhotoAtIndex:_photo.index+1 toView:_thumbView2];
-    [self assignPhotoAtIndex:_photo.index+1 toView:_thumbView2];
     [self assignPhotoAtIndex:_photo.index+2 toView:_thumbView3];
     [self assignPhotoAtIndex:_photo.index+3 toView:_thumbView4];
   }  

src/TTThumbsViewController.m

 - (id)initWithController:(TTThumbsViewController*)controller {
   if (self = [super init]) {
     _controller = controller;
-    [_controller.photoSource.delegates addObject:self];
+    _photoSource = [_controller.photoSource retain];
+    [_photoSource.delegates addObject:self];
   }
   return self;
 }
 
 - (void)dealloc {
-  [_controller.photoSource.delegates removeObject:self];
+  [_photoSource.delegates removeObject:self];
+  [_photoSource release];
   [super dealloc];
 }
 

src/Three20/TTThumbsViewController.h

 @interface TTThumbsDataSource : TTDataSource
           <TTPhotoSourceDelegate, TTThumbsTableViewCellDelegate> {
   TTThumbsViewController* _controller;
+  id<TTPhotoSource> _photoSource;
 }
 
 - (id)initWithController:(TTThumbsViewController*)controller;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.