From e5a5bc8a1edc90cf0b200956f6a3f7712766d1d6 Mon Sep 17 00:00:00 2001 From: matt handler Date: Wed, 20 Apr 2011 22:34:00 -0400 Subject: sources view controller is set up --- Classes/SourcesEditViewController.h | 27 ++ Classes/SourcesEditViewController.m | 177 +++++++++++ Classes/SourcesEditViewController.xib | 555 ++++++++++++++++++++++++++++++++++ Classes/TopicsViewController.h | 5 +- Classes/TopicsViewController.m | 17 ++ 5 files changed, 780 insertions(+), 1 deletion(-) create mode 100644 Classes/SourcesEditViewController.h create mode 100644 Classes/SourcesEditViewController.m create mode 100644 Classes/SourcesEditViewController.xib (limited to 'Classes') diff --git a/Classes/SourcesEditViewController.h b/Classes/SourcesEditViewController.h new file mode 100644 index 0000000..3e59f63 --- /dev/null +++ b/Classes/SourcesEditViewController.h @@ -0,0 +1,27 @@ +// +// SourcesEditViewController.h +// PicCast +// +// Created by Matthew Handler on 4/20/11. +// Copyright 2011 Earl Industries. All rights reserved. +// + +#import + +@protocol SourcesEditViewControllerDelegate; + +@interface SourcesEditViewController : UIViewController { + id delegate; +} + +@property (nonatomic, assign) id delegate; +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +- (IBAction)done:(id)sender; + +@end + + +@protocol SourcesEditViewControllerDelegate +- (void)sourcesEditViewControllerDelegateDidFinish:(SourcesEditViewController *)controller; +@end \ No newline at end of file diff --git a/Classes/SourcesEditViewController.m b/Classes/SourcesEditViewController.m new file mode 100644 index 0000000..7c04808 --- /dev/null +++ b/Classes/SourcesEditViewController.m @@ -0,0 +1,177 @@ +// +// SourcesEditViewController.m +// PicCast +// +// Created by Matthew Handler on 4/20/11. +// Copyright 2011 Earl Industries. All rights reserved. +// + +#import "SourcesEditViewController.h" + + +@implementation SourcesEditViewController + +@synthesize delegate, tableView; + +#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; + + //NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; + self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor]; +} + +- (IBAction)done:(id)sender { +// NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; +// [prefs setObject:[self getUserGenderString] forKey:@"userGender"]; +// [prefs setObject:[self getHeetGenderString] forKey:@"heetGender"]; +// [prefs synchronize]; + + [self.delegate sourcesEditViewControllerDidFinish:self]; +} + +/* +- (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 Table view data source + +//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +// // Return the number of sections. +// return <#number of sections#>; +//} +// +// +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + // Return the number of rows in the section. + return 10; +} + + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + } + + // Configure the cell... + + return cell; +} + + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source. + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. + } +} +*/ + + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + // Navigation logic may go here. Create and push another view controller. + /* + <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; + // ... + // Pass the selected object to the new view controller. + [self.navigationController pushViewController:detailViewController animated:YES]; + [detailViewController release]; + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Relinquish ownership any cached data, images, etc. that aren't in use. +} + +- (void)viewDidUnload { + // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand. + // For example: self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/Classes/SourcesEditViewController.xib b/Classes/SourcesEditViewController.xib new file mode 100644 index 0000000..5c21a8d --- /dev/null +++ b/Classes/SourcesEditViewController.xib @@ -0,0 +1,555 @@ + + + + 1056 + 10J567 + 823 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 132 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 292 + + YES + + + 274 + {{0, 44}, {320, 416}} + + + 3 + MQA + + NO + YES + NO + + IBCocoaTouchFramework + NO + 1 + 0 + YES + 44 + 22 + 22 + + + + 290 + {320, 44} + + IBCocoaTouchFramework + + 1 + MC4wOTMzOTc2Mzk2OSAwLjE3NTQ0MzM4MTEgMC4yNTAzODczMTEAA + + + YES + + + Title + + Done + IBCocoaTouchFramework + 1 + + + IBCocoaTouchFramework + + + + + {320, 460} + + + IBCocoaTouchFramework + + + + + YES + + + dataSource + + + + 6 + + + + delegate + + + + 7 + + + + view + + + + 9 + + + + tableView + + + + 10 + + + + done: + + + + 20 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 8 + + + YES + + + + + + + 4 + + + + + 11 + + + YES + + + + + + 14 + + + YES + + + + + + 15 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 11.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 4.IBEditorWindowLastContentRect + 4.IBPluginDependency + 4.IBViewBoundsToFrameTransform + 8.IBEditorWindowLastContentRect + 8.IBPluginDependency + + + YES + SourcesEditViewController + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{329, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAAAAAAAAw+UAAA + + {{496, 336}, {320, 460}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 22 + + + + YES + + SourcesEditViewController + UIViewController + + done: + id + + + done: + + done: + id + + + + YES + + YES + delegate + tableView + + + YES + id + UITableView + + + + YES + + YES + delegate + tableView + + + YES + + delegate + id + + + tableView + UITableView + + + + + IBProjectSource + Classes/SourcesEditViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIBarButtonItem + UIBarItem + + IBFrameworkSource + UIKit.framework/Headers/UIBarButtonItem.h + + + + UIBarItem + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIBarItem.h + + + + UINavigationBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UINavigationBar.h + + + + UINavigationItem + NSObject + + + + UIResponder + NSObject + + + + UIScrollView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIScrollView.h + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UITableView + UIScrollView + + IBFrameworkSource + UIKit.framework/Headers/UITableView.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIPrintFormatter.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ../PicCast.xcodeproj + 3 + 132 + + diff --git a/Classes/TopicsViewController.h b/Classes/TopicsViewController.h index c63635f..631a5d0 100644 --- a/Classes/TopicsViewController.h +++ b/Classes/TopicsViewController.h @@ -10,9 +10,10 @@ #import "XMLParser.h" #import "HJObjManager.h" //#import "PicDumpViewController.h" +#import "SourcesEditViewController.h" #import "PhotoViewController.h" -@interface TopicsViewController : UITableViewController { +@interface TopicsViewController : UITableViewController { UINavigationController *topicsNavigationController; NSMutableArray *topics; // PicDumpViewController *picDumpViewController; @@ -21,6 +22,8 @@ HJObjManager* objMan; } +- (IBAction)showSources:(id)sender; + @property (nonatomic, retain, readonly) UINavigationController *topicsNavigationController; @property (nonatomic, retain) PhotoViewController *photoViewController; @property (nonatomic, retain) NSMutableArray *topics; diff --git a/Classes/TopicsViewController.m b/Classes/TopicsViewController.m index 2dfc8c6..4c855d6 100644 --- a/Classes/TopicsViewController.m +++ b/Classes/TopicsViewController.m @@ -15,6 +15,7 @@ //#import "AsyncImageView.h" #import "HJObjManager.h" #import "HJManagedImageV.h" +#import "SourcesEditViewController.h" @implementation TopicsViewController @@ -63,6 +64,22 @@ // return picDumpViewController; //} +- (void) sourcesEditViewControllerDidFinish:(SourcesEditViewController *)controller { + + [self dismissModalViewControllerAnimated:YES]; + //[self _userIs:[controller getUserGenderString] heets:[controller getHeetGenderString]]; +} + +- (void) showSources:(id)sender { + SourcesEditViewController *controller = [[SourcesEditViewController alloc] initWithNibName:@"SourcesEditViewController" bundle:nil]; + controller.delegate = self; + + controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; + [self presentModalViewController:controller animated:YES]; + + [controller release]; +} + - (PhotoViewController *)photoViewController { if (photoViewController == nil) { photoViewController = [[[PhotoViewController alloc] init] autorelease]; -- cgit v1.2.3