Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 9c89bfb9524e6d7220dbfc3ea8a0f1bb5943d5eb 0 parents
@thommahoney authored
Showing with 19,194 additions and 0 deletions.
  1. BIN  20-gear2.png
  2. BIN  57-download.png
  3. BIN  71-compass.png
  4. BIN  83-calendar.png
  5. +18 −0 Classes/EventWebViewController.h
  6. +86 −0 Classes/EventWebViewController.m
  7. +385 −0 Classes/EventWebViewController.xib
  8. +16 −0 Classes/EventsViewController.h
  9. +57 −0 Classes/EventsViewController.m
  10. +27 −0 Classes/FavoriteEvent.h
  11. +22 −0 Classes/FavoriteEvent.m
  12. +40 −0 Classes/FeedCategory.h
  13. +23 −0 Classes/FeedCategory.m
  14. +31 −0 Classes/FeedDetailViewController.h
  15. +300 −0 Classes/FeedDetailViewController.m
  16. +171 −0 Classes/FeedDetailViewController.xib
  17. +27 −0 Classes/FeedEvent.h
  18. +22 −0 Classes/FeedEvent.m
  19. +52 −0 Classes/FeedViewController.h
  20. +513 −0 Classes/FeedViewController.m
  21. +433 −0 Classes/FeedViewController.xib
  22. +24 −0 Classes/LocationAnnotation.h
  23. +18 −0 Classes/LocationAnnotation.m
  24. +23 −0 Classes/MapViewController.h
  25. +115 −0 Classes/MapViewController.m
  26. +380 −0 Classes/MapViewController.xib
  27. +28 −0 Classes/MyEventsDetailViewController.h
  28. +306 −0 Classes/MyEventsDetailViewController.m
  29. +397 −0 Classes/MyEventsDetailViewController.xib
  30. +34 −0 Classes/MyEventsViewController.h
  31. +280 −0 Classes/MyEventsViewController.m
  32. +521 −0 Classes/MyEventsViewController.xib
  33. +21 −0 Classes/PlacesViewController.h
  34. +169 −0 Classes/PlacesViewController.m
  35. +385 −0 Classes/PlacesViewController.xib
  36. +38 −0 Classes/RitEventsAppDelegate.h
  37. +136 −0 Classes/RitEventsAppDelegate.m
  38. +30 −0 Classes/SettingsViewController.h
  39. +251 −0 Classes/SettingsViewController.m
  40. +176 −0 Classes/SettingsViewController.xib
  41. BIN  DarkRedButton.jpg
  42. +191 −0 MainWindow.xib
  43. BIN  RedButton.jpg
  44. +30 −0 RitEvents-Info.plist
  45. BIN  RitEvents.xcdatamodel/elements
  46. BIN  RitEvents.xcdatamodel/layout
  47. +409 −0 RitEvents.xcodeproj/project.pbxproj
  48. +7 −0 RitEvents.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  49. +12,607 −0 RitEvents.xcodeproj/project.xcworkspace/xcuserdata/Thom.xcuserdatad/UserInterfaceState.xcuserstate
  50. +76 −0 RitEvents.xcodeproj/xcuserdata/Thom.xcuserdatad/xcschemes/RitEvents.xcscheme
  51. +22 −0 RitEvents.xcodeproj/xcuserdata/Thom.xcuserdatad/xcschemes/xcschememanagement.plist
  52. +8 −0 RitEvents_Prefix.pch
  53. BIN  Tiger.jpg
  54. +114 −0 feeds.plist
  55. +17 −0 main.m
  56. +158 −0 places.plist
BIN  20-gear2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  57-download.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  71-compass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  83-calendar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 Classes/EventWebViewController.h
@@ -0,0 +1,18 @@
+//
+// EventWebViewController.h
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/20/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface EventWebViewController : UIViewController <UIWebViewDelegate> {
+ IBOutlet UIWebView *eventWebView;
+}
+
+@property (nonatomic, retain) IBOutlet UIWebView *eventWebView;
+
+@end
86 Classes/EventWebViewController.m
@@ -0,0 +1,86 @@
+//
+// EventWebViewController.m
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/20/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import "EventWebViewController.h"
+
+
+@implementation EventWebViewController
+
+@synthesize eventWebView;
+
+/*
+ // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ eventWebView.delegate = self;
+ [super viewDidLoad];
+}
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+#pragma mark UIWebViewDelegate
+- (void)webViewDidStartLoad:(UIWebView *)webView {
+ NSLog(@"webViewDidStartLoad");
+ [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
+}
+- (void)webViewDidFinishLoad:(UIWebView *)webView {
+ NSLog(@"webViewDidFinishLoad");
+ [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
+}
+- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
+ NSLog(@"webView - didFailLoadWithError");
+ [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hmm..."
+ message:[NSString stringWithFormat:@"The page isn't loading right now."]
+ delegate:self
+ cancelButtonTitle:@"Okay"
+ otherButtonTitles:nil, nil];
+ [alert show];
+ [alert release];
+ NSLog(@"\nError: %@", error);
+}
+- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
+ NSLog(@"webView - shouldStartLoadWithRequest");
+ return YES;
+}
+#pragma mark -
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [eventWebView release];
+ [super dealloc];
+}
+
+
+@end
385 Classes/EventWebViewController.xib
@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">784</int>
+ <string key="IBDocument.SystemVersion">10C540</string>
+ <string key="IBDocument.InterfaceBuilderVersion">740</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">62</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIWebView" id="330548206">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 367}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEAA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <int key="IBUIDataDetectorTypes">1</int>
+ <bool key="IBUIDetectsPhoneNumbers">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 367}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
+ <int key="IBUIStatusBarStyle">2</int>
+ </object>
+ <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
+ <int key="IBUIBarStyle">1</int>
+ <bool key="IBUIPrompted">NO</bool>
+ </object>
+ <object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">eventWebView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="330548206"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="330548206"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="330548206"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>EventWebViewController</string>
+ <string>UIResponder</string>
+ <string>{{556, 276}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">5</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">EventWebViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">eventWebView</string>
+ <string key="NS.object.0">UIWebView</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/EventWebViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="83755728">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="83755728"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIWebView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIWebView.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../RitEvents.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">3.1</string>
+ </data>
+</archive>
16 Classes/EventsViewController.h
@@ -0,0 +1,16 @@
+//
+// EventsViewController.h
+// RitEvents
+//
+// Created by student on 1/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface EventsViewController : UIViewController {
+
+}
+
+@end
57 Classes/EventsViewController.m
@@ -0,0 +1,57 @@
+//
+// EventsViewController.m
+// RitEvents
+//
+// Created by student on 1/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "EventsViewController.h"
+
+
+@implementation EventsViewController
+
+/*
+ // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
+/*
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ [super viewDidLoad];
+}
+*/
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
+@end
27 Classes/FavoriteEvent.h
@@ -0,0 +1,27 @@
+//
+// FavoriteEvent.h
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/17/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import <CoreData/CoreData.h>
+
+@class FeedCategory;
+
+@interface FavoriteEvent : NSManagedObject
+{
+}
+
+@property (nonatomic, retain) NSString * feedDetailUri;
+@property (nonatomic, retain) NSString * guid;
+@property (nonatomic, retain) NSString * title;
+@property (nonatomic, retain) NSDate * eventDate;
+@property (nonatomic, retain) NSString * feedDescription;
+@property (nonatomic, retain) FeedCategory * FeedCategory;
+
+@end
+
+
+
22 Classes/FavoriteEvent.m
@@ -0,0 +1,22 @@
+//
+// FavoriteEvent.m
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/17/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import "FavoriteEvent.h"
+
+#import "FeedCategory.h"
+
+@implementation FavoriteEvent
+
+@dynamic feedDetailUri;
+@dynamic guid;
+@dynamic title;
+@dynamic eventDate;
+@dynamic feedDescription;
+@dynamic FeedCategory;
+
+@end
40 Classes/FeedCategory.h
@@ -0,0 +1,40 @@
+//
+// FeedCategory.h
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/21/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import <CoreData/CoreData.h>
+
+@class FavoriteEvent;
+@class FeedEvent;
+
+@interface FeedCategory : NSManagedObject
+{
+}
+
+@property (nonatomic, retain) NSString * uriOptionValue;
+@property (nonatomic, retain) NSDate * updateTimestamp;
+@property (nonatomic, retain) NSNumber * isSubscribedTo;
+@property (nonatomic, retain) NSString * name;
+@property (nonatomic, retain) NSSet* FavoriteEvents;
+@property (nonatomic, retain) NSSet* FeedEvents;
+
+@end
+
+
+@interface FeedCategory (CoreDataGeneratedAccessors)
+- (void)addFavoriteEventsObject:(FavoriteEvent *)value;
+- (void)removeFavoriteEventsObject:(FavoriteEvent *)value;
+- (void)addFavoriteEvents:(NSSet *)value;
+- (void)removeFavoriteEvents:(NSSet *)value;
+
+- (void)addFeedEventsObject:(FeedEvent *)value;
+- (void)removeFeedEventsObject:(FeedEvent *)value;
+- (void)addFeedEvents:(NSSet *)value;
+- (void)removeFeedEvents:(NSSet *)value;
+
+@end
+
23 Classes/FeedCategory.m
@@ -0,0 +1,23 @@
+//
+// FeedCategory.m
+// RitEvents
+//
+// Created by Thomas Mahoney on 2/21/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import "FeedCategory.h"
+
+#import "FavoriteEvent.h"
+#import "FeedEvent.h"
+
+@implementation FeedCategory
+
+@dynamic uriOptionValue;
+@dynamic updateTimestamp;
+@dynamic isSubscribedTo;
+@dynamic name;
+@dynamic FavoriteEvents;
+@dynamic FeedEvents;
+
+@end
31 Classes/FeedDetailViewController.h
@@ -0,0 +1,31 @@
+//
+// FeedDetailViewController.h
+// RitEvents
+//
+// Created by Andrew Church on 14/02/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <CoreData/CoreData.h>
+#import <MessageUI/MessageUI.h>
+#import "FeedEvent.h"
+#import "FavoriteEvent.h"
+
+@interface FeedDetailViewController : UIViewController <MFMailComposeViewControllerDelegate> {
+ NSManagedObjectContext *context;
+ FeedEvent *event;
+ NSDateFormatter *dateFormatter;
+}
+
+@property (nonatomic,retain) NSManagedObjectContext *context;
+@property (nonatomic,retain) FeedEvent *event;
+
+- (void)addToMyEvents;
+- (void)sendEmail;
+- (void)displayComposerSheet;
+- (void)launchMailAppOnDevice;
+- (NSString *)trim:(NSString *)original;
+
+
+@end
300 Classes/FeedDetailViewController.m
@@ -0,0 +1,300 @@
+//
+// FeedDetailViewController.m
+// RitEvents
+//
+// Created by Andrew Church on 2/14/2010.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import "FeedDetailViewController.h"
+#import "EventWebViewController.h"
+
+@implementation FeedDetailViewController
+
+@synthesize event;
+@synthesize context;
+
+/*
+ // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+ // Custom initialization
+ }
+ return self;
+ }
+ */
+
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ self.title = event.title;
+ dateFormatter = [[NSDateFormatter alloc] init];
+ [dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss zzz"];
+ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Add"
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(addToMyEvents)];
+ [super viewDidLoad];
+}
+
+/*
+ // Override to allow orientations other than the default portrait orientation.
+ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+ }
+ */
+
+#pragma mark UITableViewDelegate methods
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return 5;
+}
+
+
+// Customize the number of rows in the table view.
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ switch (section) {
+ default:
+ return 1;
+ break;
+ }
+}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+ switch (section) {
+ case 0:
+ return @"Event Title";
+ break;
+ case 1:
+ return @"Date";
+ break;
+ case 2:
+ return @"Description";
+ break;
+ case 3:
+ return @"Share";
+ break;
+ case 4:
+ return @"Link";
+ break;
+ default:
+ return @"";
+ break;
+ }
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+ NSLog(@"heightForRowAtIndexPath");
+ NSString *cellText;
+ switch ([indexPath section]) {
+ case 0:
+ cellText = event.title;
+ break;
+ case 1:
+ cellText = [dateFormatter stringFromDate:event.eventDate];
+ break;
+ case 2:
+ cellText = event.feedDescription;
+ break;
+ default:
+ return 44;
+ break;
+ }
+ UIFont *cellFont = [UIFont fontWithName:@"Helvetica" size:14.0];
+ CGSize constraintSize = CGSizeMake(280.0f, MAXFLOAT);
+ CGSize labelSize = [cellText sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];
+ return labelSize.height + 15;
+}
+
+// Customize the appearance of table view cells.
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ NSLog(@"cellForRowAtIndexPath called");
+ static NSString *CellIdentifier = @"Cell";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ }
+
+ cell.accessoryType = UITableViewCellAccessoryNone;
+ cell.textLabel.font = [UIFont systemFontOfSize:14];
+ cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
+ cell.textLabel.textAlignment = UITextAlignmentLeft;
+ cell.textLabel.textColor = [UIColor blackColor];
+ cell.backgroundColor = [UIColor whiteColor];
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
+ // as many lines as it needs
+ cell.textLabel.numberOfLines = 0;
+
+ switch ([indexPath section]) {
+ case 0:
+ cell.textLabel.text = event.title;
+ break;
+ case 1:
+ cell.textLabel.text = [dateFormatter stringFromDate:event.eventDate];
+ break;
+ case 2:
+ cell.textLabel.text = [NSString stringWithFormat:@"\n%@", event.feedDescription];
+ break;
+ case 3:
+ cell.textLabel.text = @"Email";
+ cell.selectionStyle = UITableViewCellSelectionStyleBlue;
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ cell.textLabel.numberOfLines = 1;
+ break;
+ case 4:
+ cell.textLabel.text = event.guid;
+ cell.textLabel.numberOfLines = 1;
+ cell.textLabel.lineBreakMode = UILineBreakModeTailTruncation;
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ cell.selectionStyle = UITableViewCellSelectionStyleBlue;
+ break;
+
+ default:
+ break;
+ }
+
+ return cell;
+}
+
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
+ if([indexPath section] == 3) {
+ [self sendEmail];
+ } else if([indexPath section] == 4) {
+ EventWebViewController *eventWebViewController = [[EventWebViewController alloc] initWithNibName:@"EventWebViewController" bundle:nil];
+ [self.navigationController pushViewController:eventWebViewController animated:YES];
+ eventWebViewController.title = event.title;
+ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@&show_small_window=T", [self trim:event.feedDetailUri]]];
+ NSLog(@"URL: %@", url);
+ NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];
+ [eventWebViewController.eventWebView loadRequest:request];
+ [eventWebViewController release];
+ }
+}
+
+#pragma mark -
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+- (NSString *)trim:(NSString *)original {
+ NSMutableString *copy = [original mutableCopy];
+ return [NSString stringWithString:[copy stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
+}
+
+#pragma mark Private Members
+
+- (void)addToMyEvents
+{
+ FavoriteEvent *newFavorite;
+ newFavorite = [NSEntityDescription insertNewObjectForEntityForName:@"FavoriteEvent" inManagedObjectContext:context];
+ newFavorite.title = event.title;
+ newFavorite.guid = event.guid;
+ newFavorite.eventDate = event.eventDate;
+ newFavorite.FeedCategory = event.FeedCategory;
+ newFavorite.feedDescription = event.feedDescription;
+ newFavorite.feedDetailUri = event.feedDetailUri;
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Event Saved"
+ message:[NSString stringWithFormat:@"Added %@ to My Events.", event.title]
+ delegate:self
+ cancelButtonTitle:@"Okay"
+ otherButtonTitles:nil, nil];
+ [alert show];
+ [alert release];
+ NSLog(@"Added to My Events");
+}
+
+#pragma mark Compose Mail
+/*
+ Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ This code has been modified from its original source (above) to fit the needs of the RIT Events application
+ */
+-(void)sendEmail
+{
+ // This sample can run on devices running iPhone OS 2.0 or later
+ // The MFMailComposeViewController class is only available in iPhone OS 3.0 or later.
+ // So, we must verify the existence of the above class and provide a workaround for devices running
+ // earlier versions of the iPhone OS.
+ // We display an email composition interface if MFMailComposeViewController exists and the device can send emails.
+ // We launch the Mail application on the device, otherwise.
+
+ Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
+ if (mailClass != nil)
+ {
+ // We must always check whether the current device is configured for sending emails
+ if ([mailClass canSendMail])
+ {
+ [self displayComposerSheet];
+ }
+ else
+ {
+ [self launchMailAppOnDevice];
+ }
+ }
+ else
+ {
+ [self launchMailAppOnDevice];
+ }
+}
+
+// Displays an email composition interface inside the application. Populates all the Mail fields.
+-(void)displayComposerSheet
+{
+ MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
+ picker.mailComposeDelegate = self;
+
+ [picker setSubject:event.title];
+
+ // Fill out the email body text
+ NSString *emailBody = [NSString stringWithFormat:@"<br /><br /><b>Event Title:</b> %@<br /><br /><b>Date:</b> %@<br /><br /><b>Description:</b> %@<br /><br /><b>URL:</b> <a href=\"%@\">%@</a>", event.title, [dateFormatter stringFromDate:event.eventDate], event.feedDescription, event.feedDetailUri, event.feedDetailUri];
+ [picker setMessageBody:emailBody isHTML:YES];
+
+ [self presentModalViewController:picker animated:YES];
+ [picker release];
+}
+
+
+// Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the message field with the result of the operation.
+- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
+{
+ [self dismissModalViewControllerAnimated:YES];
+}
+
+
+#pragma mark -
+#pragma mark Workaround
+
+// Launches the Mail application on the device.
+-(void)launchMailAppOnDevice
+{
+ NSString *body = [NSString stringWithFormat:@"<br /><br /><b>Event Title:</b> %@<br /><br /><b>Date:</b> %@<br /><br /><b>Description:</b> %@<br /><br /><b>URL:</b> <a href=\"%@\">%@</a>", event.title, [dateFormatter stringFromDate:event.eventDate], event.feedDescription, event.feedDetailUri, event.feedDetailUri];
+
+ NSString *email = [NSString stringWithFormat:@"%@%@", nil, body];
+ email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
+}
+
+
+#pragma mark -
+
+- (void)dealloc {
+ [context release];
+ [event release];
+ [dateFormatter release];
+ [super dealloc];
+}
+
+
+@end
171 Classes/FeedDetailViewController.xib
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
+ <data>
+ <int key="IBDocument.SystemTarget">784</int>
+ <string key="IBDocument.SystemVersion">9F33</string>
+ <string key="IBDocument.InterfaceBuilderVersion">680</string>
+ <string key="IBDocument.AppKitVersion">949.34</string>
+ <string key="IBDocument.HIToolboxVersion">352.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="4"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ </object>
+ <object class="IBUITableView" id="873029372">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrameSize">{320, 367}</string>
+ <reference key="NSSuperview"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
+ <bool key="IBUIPrompted">NO</bool>
+ </object>
+ <object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
+ <bool key="IBUIBouncesZoom">NO</bool>
+ <int key="IBUIStyle">1</int>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">4.400000e+01</float>
+ <float key="IBUISectionHeaderHeight">1.000000e+01</float>
+ <float key="IBUISectionFooterHeight">1.000000e+01</float>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="873029372"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="105149124">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="105149124"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="105149124"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="873029372"/>
+ <reference key="parent" ref="105149124"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>4.IBEditorWindowLastContentRect</string>
+ <string>4.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>FeedDetailViewController</string>
+ <string>UIResponder</string>
+ <string>{{192, 180}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">FeedDetailViewController</string>
+ <string key="superclassName">UITableViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/FeedDetailViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <nil key="IBDocument.LastKnownRelativeProjectPath"/>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">3.1</string>
+ </data>
+</archive>
27 Classes/FeedEvent.h
@@ -0,0 +1,27 @@
+//
+// FeedEvent.h
+// RitEvents
+//
+// Created by Andrew Church on 2/15/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <CoreData/CoreData.h>
+
+@class FeedCategory;
+
+@interface FeedEvent : NSManagedObject
+{
+}
+
+@property (nonatomic, retain) NSDate * eventDate;
+@property (nonatomic, retain) NSString * title;
+@property (nonatomic, retain) NSString * feedDetailUri;
+@property (nonatomic, retain) NSString * guid;
+@property (nonatomic, retain) NSString * feedDescription;
+@property (nonatomic, retain) FeedCategory * FeedCategory;
+
+@end
+
+
+
22 Classes/FeedEvent.m
@@ -0,0 +1,22 @@
+//
+// FeedEvent.m
+// RitEvents
+//
+// Created by Andrew Church on 2/15/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "FeedEvent.h"
+
+#import "FeedCategory.h"
+
+@implementation FeedEvent
+
+@dynamic eventDate;
+@dynamic title;
+@dynamic feedDetailUri;
+@dynamic guid;
+@dynamic feedDescription;
+@dynamic FeedCategory;
+
+@end
52 Classes/FeedViewController.h
@@ -0,0 +1,52 @@
+//
+// FeedViewController.h
+// RitEvents
+//
+// Created by Thomas Mahoney on 1/28/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <CoreData/CoreData.h>
+#import "FeedEvent.h"
+
+@interface FeedViewController : UITableViewController <UIAlertViewDelegate, NSXMLParserDelegate> {
+ NSManagedObjectContext *context;
+ NSString *urlString;
+ NSMutableData *responseData;
+ NSXMLParser *xml;
+ FeedCategory *currentParsingCategory;
+ NSMutableString *pendingTitle;
+ NSMutableString *pendingLink;
+ NSMutableString *pendingDescription;
+ NSMutableString *pendingGuid;
+ NSMutableString *pendingDateString;
+ NSString *currentElement;
+ BOOL isParsing;
+ int currentCategoryFetchingIndex;
+ NSMutableArray *cachedFeedCategories;
+ NSMutableArray *categoriesToUpdate;
+ NSMutableDictionary *cachedFeedEvents;
+ NSDateFormatter *dateFormatter;
+ BOOL viewDidLoadWorking;
+ IBOutlet UITableView *feedTableView;
+ BOOL hasStartedItemList;
+}
+
+@property (retain, nonatomic) NSManagedObjectContext *context;
+
+- (void)parseData;
+- (void)loadNewFeedData;
+- (NSMutableArray *)getSubscribedFeedCategories;
+- (NSMutableArray *)getEventsForCategory:(NSString *)categoryName;
+- (void)loadNewFeedsForCategory:(int)categoryArrayIndex;
+- (void)loadCache;
+- (NSString *)trim:(NSString *)original;
+- (void)threadedRefresh:(BOOL)usingTimestamps;
+- (void)initThreadedLoadByTimestamp;
+- (void)loadNewFeedDataByTimestamp;
+- (void)initThreadedLoad;
+- (BOOL)isFeedSourceAvailable;
+- (void)refreshButtonSelected;
+
+@end
513 Classes/FeedViewController.m
@@ -0,0 +1,513 @@
+//
+// FeedViewController.m
+// RitEvents
+//
+// Created by Thomas Mahoney on 1/28/10.
+// Copyright 2010 Home Use. All rights reserved.
+//
+
+#import "FeedViewController.h"
+#import "FeedCategory.h"
+#import "FeedEvent.h"
+#import "FeedDetailViewController.h"
+#import <SystemConfiguration/SystemConfiguration.h>
+#define BASE_FEED_URI @"http://events.rit.edu/web_service/rss_feed.cfm?categories="
+#define URI_ENCODED_CATEGORY_DELIMITER @"%2C"
+
+
+@implementation FeedViewController
+
+@synthesize context;
+
+/*
+- (id)initWithStyle:(UITableViewStyle)style {
+ // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+ if (self = [super initWithStyle:style]) {
+ }
+ return self;
+}
+*/
+
+- (void)viewDidLoad {
+ NSLog(@"viewDidLoad");
+ self.title = @"Event Feed";
+ hasStartedItemList = NO;
+ [self loadCache];
+ dateFormatter = [[NSDateFormatter alloc] init];
+ [dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss zzz"];
+ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Refresh"
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(refreshButtonSelected)];
+ if([cachedFeedCategories count] == 0)
+ {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Feed Subscriptions"
+ message:@"You have not subscribed to any RIT Event feeds."
+ delegate:self cancelButtonTitle:@"Cancel"
+ otherButtonTitles:@"Settings", nil];
+ [alert show];
+ [alert release];
+ }
+ else
+ {
+ viewDidLoadWorking = YES;
+ [self threadedRefresh:NO];
+ }
+ [super viewDidLoad];
+}
+
+-(void)refreshButtonSelected
+{
+ [self threadedRefresh:NO];
+}
+
+- (BOOL)isFeedSourceAvailable{
+ const char *hostname = "events.rit.edu";
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname);
+ SCNetworkReachabilityFlags flags;
+ return SCNetworkReachabilityGetFlags(reachability, &flags);
+}
+
+-(void)threadedRefresh:(BOOL)usingTimestamps
+{
+
+ if([self isFeedSourceAvailable])
+ {
+ if(!usingTimestamps)
+ {
+ [NSThread detachNewThreadSelector:@selector(initThreadedLoad) toTarget:self withObject:nil];
+ }
+ else {
+ [NSThread detachNewThreadSelector:@selector(initThreadedLoadByTimestamp) toTarget:self withObject:nil];
+ }
+
+ }
+ else
+ {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Network Connection Issue"
+ message:@"events.rit.edu is unavailable."
+ delegate:nil cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ }
+
+}
+
+- (void)initThreadedLoad
+{
+ NSLog(@"initThreadedLoad");
+ [self performSelectorOnMainThread:@selector(loadNewFeedData) withObject:nil waitUntilDone:NO];
+}
+
+- (void)initThreadedLoadByTimestamp
+{
+ NSLog(@"initThreadedLoadByTimestamp");
+ [self performSelectorOnMainThread:@selector(loadNewFeedDataByTimestamp) withObject:nil waitUntilDone:NO];
+}
+
+- (void)viewDidAppear:(BOOL)animated {
+ NSLog(@"View Did Appear");
+ if(!viewDidLoadWorking)
+ {
+ cachedFeedCategories = [self getSubscribedFeedCategories];
+ [self threadedRefresh:YES];
+ }
+ [super viewDidAppear:animated];
+}
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+#pragma mark Table view methods
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return [cachedFeedCategories count];
+}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+ return [(FeedCategory *)[cachedFeedCategories objectAtIndex:section] name];
+}
+
+
+// Customize the number of rows in the table view.
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ // NSLog(@"numberOfRowsInSection");
+ FeedCategory *category = [cachedFeedCategories objectAtIndex:section];
+ if([[cachedFeedEvents objectForKey:[category name]] count] == 0) return 1;
+ return [[cachedFeedEvents objectForKey:[category name]] count];
+}
+
+
+// Customize the appearance of table view cells.
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ // NSLog(@"cellForRowAtIndexPath");
+ static NSString *CellIdentifier = @"Cell";
+
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
+ }
+
+ FeedCategory *category = [cachedFeedCategories objectAtIndex:[indexPath section]];
+ NSMutableArray *events = [cachedFeedEvents objectForKey:[category name]];
+ //NSLog(@"Category found: %@", category);
+
+ if([events count] != 0)
+ {
+ FeedEvent *event = [events objectAtIndex:[indexPath row]];
+ cell.textLabel.text = event.title;
+ cell.detailTextLabel.text = [dateFormatter stringFromDate:event.eventDate];
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ }
+ else
+ {
+ cell.textLabel.text = @"No upcoming events";
+ cell.detailTextLabel.text = @"";
+ cell.accessoryType = UITableViewCellAccessoryNone;
+ }
+
+ cell.textLabel.font = [UIFont systemFontOfSize:14];
+
+ return cell;
+}
+
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
+ FeedCategory *category = [cachedFeedCategories objectAtIndex:[indexPath section]];
+ [feedTableView deselectRowAtIndexPath:indexPath animated:YES];
+ if([[category FeedEvents] count] > 0)
+ {
+ FeedDetailViewController *feedDVC = [[FeedDetailViewController alloc]
+ initWithNibName:@"FeedDetailViewController"
+ bundle:nil];
+ FeedCategory *category = [cachedFeedCategories objectAtIndex:[indexPath section]];
+ NSMutableArray *events = [cachedFeedEvents objectForKey:[category name]];
+ feedDVC.event = [events objectAtIndex:[indexPath row]];
+ feedDVC.context = context;
+ [self.navigationController pushViewController:feedDVC animated:YES];
+ [feedDVC release];
+ }
+}
+
+
+#pragma mark -
+#pragma mark NSXmlParser delegate methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict {
+ currentElement = [elementName copy];
+ if([elementName isEqual:@"item"]) {
+ hasStartedItemList = YES;
+ pendingTitle = [[NSMutableString alloc] init];
+ pendingDescription = [[NSMutableString alloc] init];
+ pendingLink = [[NSMutableString alloc] init];
+ pendingGuid = [[NSMutableString alloc] init];
+ pendingDateString = [[NSMutableString alloc] init];
+ }
+}
+
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
+ NSLog(@"foundCharacters: %@", string);
+ if(hasStartedItemList) {
+ if ([currentElement isEqualToString:@"title"]) {
+ [pendingTitle appendString:string];
+ } else if ([currentElement isEqualToString:@"link"]) {
+ [pendingLink appendString:string];
+ } else if ([currentElement isEqualToString:@"description"]) {
+ [pendingDescription appendString:string];
+ } else if ([currentElement isEqualToString:@"guid"]) {
+ [pendingGuid appendString:string];
+ } else if([currentElement isEqualToString:@"pubDate"]){
+ [pendingDateString appendString:string];
+ }
+ }
+}
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
+ if ([elementName isEqualToString:@"item"]) {
+ NSLog(@"saving new event");
+
+ FeedEvent *event;
+ event = [NSEntityDescription
+ insertNewObjectForEntityForName:@"FeedEvent"
+ inManagedObjectContext:context];
+
+ event.title = [self trim:pendingTitle];
+ event.feedDescription = pendingDescription;
+ event.feedDetailUri = pendingLink;
+ NSLog(@"Link: %@", pendingLink);
+ event.guid = pendingGuid;
+ event.eventDate = [dateFormatter dateFromString:pendingDateString];
+ NSMutableSet *eventsSet = [[categoriesToUpdate objectAtIndex:currentCategoryFetchingIndex] mutableSetValueForKey:@"FeedEvents"];
+ [eventsSet addObject:event];
+ event.FeedCategory = [categoriesToUpdate objectAtIndex:currentCategoryFetchingIndex];
+ [[categoriesToUpdate objectAtIndex:currentCategoryFetchingIndex] setUpdateTimestamp:[NSDate date]];
+ }
+}
+
+
+
+- (void)parserDidEndDocument:(NSXMLParser *)parser{
+ //NSLog(@"parserDidEndDocument parser=%@",parser);
+ NSLog(@"ended Document");
+ hasStartedItemList = NO;
+ if(isParsing && currentCategoryFetchingIndex < ([categoriesToUpdate count]-1))
+ {
+ currentCategoryFetchingIndex = currentCategoryFetchingIndex+1;
+ [self loadNewFeedsForCategory:currentCategoryFetchingIndex];
+ }
+ else if(currentCategoryFetchingIndex == ([categoriesToUpdate count]-1))
+ {
+ isParsing = NO;
+ NSError *error;
+ if(![context save:&error])
+ {
+ NSLog(@"Error saving need feed data: %@",error);
+ }
+ else
+ {
+ NSLog(@"Successfully saved new feed data");
+ }
+
+ [self loadCache];
+ [feedTableView reloadData];
+ viewDidLoadWorking = NO;
+ }
+
+}
+#pragma mark -
+
+#pragma mark NSURLConnection delegate methods
+
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{
+ // cast NSURLResponse to NSHTTPURLResponse
+ //NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *)response;
+ // Log info about response
+ // Hey, where's the data?
+ //NSLog(@"didReceiveResponse response = %@",httpResponse);
+ //NSLog(@"status code = %d",[httpResponse statusCode] );
+ //NSLog(@"headers = %@",[httpResponse allHeaderFields] );
+ // [connection release];
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
+ [responseData appendData:data];
+}
+
+-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
+ NSLog(@"connectionDidFinishLoading");
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:FALSE];
+ [self parseData];
+ [connection release];
+ //[responseData release];
+}
+
+
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
+
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:FALSE];
+
+ [connection release];
+ NSLog(@"didFailWithError error= %@",error);
+}
+
+#pragma mark -
+
+#pragma mark AlertViewDelgate methods
+
+- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
+ switch(buttonIndex) {
+ case 0:
+ //cancel
+ break;
+ case 1:
+ self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:3];
+ break;
+ default:
+ break;
+ }
+}
+
+#pragma mark -
+
+#pragma mark FeedViewController Private Members
+
+
+- (void)loadNewFeedData{
+ NSLog(@"Load New Feeds");
+ cachedFeedCategories = [self getSubscribedFeedCategories];
+ categoriesToUpdate = cachedFeedCategories;
+ if([categoriesToUpdate count] > 0)
+ {
+ isParsing = YES;
+ currentCategoryFetchingIndex = 0;
+ [self loadNewFeedsForCategory:0];
+ }
+ else
+ {
+ [feedTableView reloadData];
+ }
+
+}
+
+- (void)loadNewFeedDataByTimestamp
+{
+ if(categoriesToUpdate != nil) {
+ [categoriesToUpdate removeAllObjects];
+ }
+ for(FeedCategory *category in cachedFeedCategories)
+ {
+ NSLog(@"minutesSinceLastUpdate: %f)",[[NSDate date] timeIntervalSinceDate: [category updateTimestamp]]/60);
+ if(nil == [category updateTimestamp] || ([[NSDate date] timeIntervalSinceDate: [category updateTimestamp]]/60) > 5)
+ {
+ [categoriesToUpdate addObject:category];
+ }
+ }
+ if([categoriesToUpdate count] > 0)
+ {
+ isParsing = YES;
+ currentCategoryFetchingIndex = 0;
+ [self loadNewFeedsForCategory:0];
+ }
+ else {
+ [feedTableView reloadData];
+ }
+
+}
+
+- (void)loadNewFeedsForCategory:(int)categoryArrayIndex
+{
+ NSLog(@"loadNewFeedsForCategory:%d",categoryArrayIndex);
+ currentParsingCategory = (FeedCategory *)[categoriesToUpdate objectAtIndex:categoryArrayIndex];
+ //NSLog(@"loadNewFeedsForCategory: %@",currentParsingCategory);
+
+ if([[currentParsingCategory FeedEvents] count] > 0)
+ {
+ [[currentParsingCategory mutableSetValueForKey:@"FeedEvents"] removeAllObjects];
+ }
+
+ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",BASE_FEED_URI,[currentParsingCategory uriOptionValue]]];
+ NSURLRequest *request = [NSURLRequest requestWithURL:url
+ // respect server's cacheing policy
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:10.0];
+
+ // make the connection and retrieve the data
+ NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
+ if (connection){
+ NSLog(@"Started Connection");
+ responseData = [[NSMutableData data] retain];
+ NSLog(@"Retained mutable data");
+ // show network activity indicator
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:TRUE];
+
+ }
+
+}
+
+- (void)parseData{
+ NSLog(@"Parsing...");
+ if(xml != nil) {
+ [xml release];
+ }
+ xml = [[NSXMLParser alloc] initWithData:responseData];
+ [xml setDelegate:self];
+ [xml setShouldResolveExternalEntities:NO];
+ [xml setShouldProcessNamespaces:NO];
+ [xml setShouldReportNamespacePrefixes:NO];
+ if(![xml parse]){
+ NSLog(@"error in parse. error=%@", [xml parserError] );
+ if(xml)[xml release];
+ }
+
+}
+
+- (NSMutableArray *)getSubscribedFeedCategories
+{
+ NSError *error;
+ NSFetchRequest *req = [NSFetchRequest new];
+ NSEntityDescription *descr = [NSEntityDescription entityForName:@"FeedCategory"
+ inManagedObjectContext:context];
+ [req setEntity:descr];
+
+ NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"name"
+ ascending:YES];
+ [req setSortDescriptors:[NSArray arrayWithObject:sort]];
+ [sort release];
+ [req setPredicate:[NSPredicate predicateWithFormat:@"isSubscribedTo = %d",1]];
+ [req autorelease];
+ return [[context executeFetchRequest:req error:&error] mutableCopy];
+}
+
+- (NSMutableArray *)getEventsForCategory:(NSString *)categoryName
+{
+ NSString *category = [categoryName copy];
+ NSError *error;
+ NSFetchRequest *req = [NSFetchRequest new];
+ NSEntityDescription *descr = [NSEntityDescription entityForName:@"FeedEvent"
+ inManagedObjectContext:context];
+ [req setEntity:descr];
+
+ NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"eventDate"
+ ascending:YES];
+ [req setSortDescriptors:[NSArray arrayWithObject:sort]];
+ [sort release];
+ [req setPredicate:[NSPredicate predicateWithFormat:@"FeedCategory.name like[cd] %@",category]];
+ [req autorelease];
+ return [[context executeFetchRequest:req error:&error] mutableCopy];
+}
+
+- (void)loadCache
+{
+ NSLog(@"Loading Cache");
+ if(! cachedFeedEvents) cachedFeedEvents = [[NSMutableDictionary alloc] init];
+ [cachedFeedEvents removeAllObjects];
+ cachedFeedCategories = [self getSubscribedFeedCategories];
+
+ for(FeedCategory *category in cachedFeedCategories)
+ {
+ [cachedFeedEvents setObject:[self getEventsForCategory:[category name]] forKey:[category name]];
+ }
+}
+
+- (NSString *)trim:(NSString *)original {
+ NSMutableString *copy = [original mutableCopy];
+ return [NSString stringWithString:[copy stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
+}
+
+#pragma mark -
+
+- (void)dealloc {
+ [urlString release];
+ [responseData release];
+ [xml release];
+ [currentParsingCategory release];
+ [pendingTitle release];
+ [pendingLink release];
+ [pendingDescription release];
+ [pendingGuid release];
+ [pendingDateString release];
+ [currentElement release];
+ [cachedFeedCategories release];
+ [categoriesToUpdate release];
+ [cachedFeedEvents release];
+ [dateFormatter release];
+ [feedTableView release];
+ [super dealloc];
+}
+
+
+@end
+
433 Classes/FeedViewController.xib
@@ -0,0 +1,433 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">784</int>
+ <string key="IBDocument.SystemVersion">10C540</string>
+ <string key="IBDocument.InterfaceBuilderVersion">740</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">62</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="4"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ </object>
+ <object class="IBUITableView" id="873029372">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrameSize">{320, 367}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwAA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
+ <int key="IBUIStatusBarStyle">2</int>
+ </object>
+ <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
+ <int key="IBUIBarStyle">1</int>
+ <bool key="IBUIPrompted">NO</bool>
+ </object>
+ <object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
+ <bool key="IBUIBouncesZoom">NO</bool>
+ <int key="IBUIStyle">1</int>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">10</float>
+ <float key="IBUISectionFooterHeight">10</float>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="873029372"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="873029372"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">feedTableView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="873029372"/>
+ </object>
+ <int key="connectionID">12</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="873029372"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>4.IBEditorWindowLastContentRect</string>
+ <string>4.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>FeedViewController</string>
+ <string>UIResponder</string>
+ <string>{{655, 244}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">12</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">FeedViewController</string>
+ <string key="superclassName">UITableViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">toggleSortStyle:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>feedTableView</string>
+ <string>sortToggle</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITableView</string>
+ <string>UISegmentedControl</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/FeedViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="s