diff options
author | matt handler <matt.handler@gmail.com> | 2011-04-26 17:21:39 -0400 |
---|---|---|
committer | matt handler <matt.handler@gmail.com> | 2011-04-26 17:21:39 -0400 |
commit | 1ee16b02d54bd8c71ae365bdb56d7389702839ea (patch) | |
tree | 1b05910b89d0fc3a788d1f9d3e888d53082bf669 /Classes | |
parent | 46642320901ebaaedae5618e423ebfe70f316351 (diff) | |
download | piccast-app-1ee16b02d54bd8c71ae365bdb56d7389702839ea.tar.gz piccast-app-1ee16b02d54bd8c71ae365bdb56d7389702839ea.zip |
sort topics when popping out of the database, customize photoview controller, need to add sharekit
Diffstat (limited to 'Classes')
-rw-r--r-- | Classes/PhotoViewController.m | 53 | ||||
-rw-r--r-- | Classes/TopicsViewController.m | 91 |
2 files changed, 94 insertions, 50 deletions
diff --git a/Classes/PhotoViewController.m b/Classes/PhotoViewController.m index 1b43094..151aabd 100644 --- a/Classes/PhotoViewController.m +++ b/Classes/PhotoViewController.m @@ -8,6 +8,59 @@ #import "PhotoViewController.h" #import "PhotoSource.h" +#import <Three20/Three20.h> + +@interface MyPhotoViewController : TTPhotoViewController +{ + +} +@end + +@implementation MyPhotoViewController + +-(void)viewDidLoad{ + // New item to be added + UIBarButtonItem *shareItem = [[UIBarButtonItem alloc] + initWithTitle:@"Share" style:UIBarButtonItemStyleBordered target:self + action:@selector(action:)]; + UIBarButtonItem *customItem = [[UIBarButtonItem alloc] + initWithTitle:@"Save" style:UIBarButtonItemStyleBordered target:self + action:@selector(action:)]; + // Flex space to keep the back / forward arrows centered + UIBarButtonItem *flex = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil action:nil]; + UIBarButtonItem *flex2 = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil action:nil]; + // Create array with items starting with the left side + NSMutableArray *items = [NSMutableArray arrayWithObject:shareItem]; + [items addObject:flex]; + // Then add the current items (the back / forward arrows) + [items addObjectsFromArray:[_toolbar items]]; + [items addObject:flex2]; + // Add in our new item to the far right + [items addObject:customItem]; + [_toolbar setItems:items]; + [shareItem release]; + [customItem release]; + [flex release]; + [flex2 release]; +} + +-(void)action:(id)sender{ + // Perform your action +} + +@end + + +@implementation TTThumbsViewController (test) +- (TTPhotoViewController*)createPhotoViewController { + NSLog(@"test"); + return (TTPhotoViewController *)[[[MyPhotoViewController alloc] init] autorelease]; +} +@end @implementation PhotoViewController diff --git a/Classes/TopicsViewController.m b/Classes/TopicsViewController.m index 1d93566..78258d7 100644 --- a/Classes/TopicsViewController.m +++ b/Classes/TopicsViewController.m @@ -31,18 +31,9 @@ [super viewDidLoad]; NSLog(@"viewDidLoad"); self.tableView.rowHeight = 100; - //UIBarButtonItem *doneItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(returnToParserChoices)] autorelease]; - //self.navigationItem.rightBarButtonItem = doneItem; - // Create the object manager objMan = [[HJObjManager alloc] initWithLoadingBufferSize:6 memCacheSize:20]; - //if you are using for full screen images, you'll need a smaller memory cache than the defaults, - //otherwise the cached images will get you out of memory quickly - //objMan = [[HJObjManager alloc] initWithLoadingBufferSize:6 memCacheSize:1]; - - // Create a file cache for the object manager to use - // A real app might do this durring startup, allowing the object manager and cache to be shared by several screens NSString* cacheDirectory = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/imgcache/icons/"] ; HJMOFileCache* fileCache = [[[HJMOFileCache alloc] initWithRootPath:cacheDirectory] autorelease]; objMan.fileCache = fileCache; @@ -67,7 +58,7 @@ - (void) getTopicsFromDb { // grab topics [db open]; - FMResultSet *fResult = [db executeQuery:@"SELECT * FROM picCasts"]; //order by date, limite _max + FMResultSet *fResult = [db executeQuery:@"SELECT * FROM picCasts ORDER BY releaseDate DESC"]; //order by date, limite _max // put into sections while([fResult next]) @@ -116,46 +107,6 @@ } #pragma mark - -#pragma mark View lifecycle - -/* -- (void)viewDidLoad { - [super viewDidLoad]; - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem; -} -*/ - -/* -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; -} -*/ -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ -/* -// Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations. - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} -*/ - -#pragma mark - #pragma mark custom sheeyit - (void) addTopicsFromJson:(NSData *)data { @@ -352,6 +303,46 @@ } +#pragma mark - +#pragma mark View lifecycle + +/* + - (void)viewDidLoad { + [super viewDidLoad]; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + } + */ + +/* + - (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + } + */ +/* + - (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + } + */ +/* + - (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + } + */ +/* + - (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + } + */ +/* + // Override to allow orientations other than the default portrait orientation. + - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations. + return (interfaceOrientation == UIInterfaceOrientationPortrait); + } + */ + #pragma mark <iTunesRSSParserDelegate> Implementation - (void)startParsing { |