Permalink
Browse files

Revert "cleanup". I'm not sure why it deleted everything, but that c…

…learly wasn't the intended change.

This reverts commit f381ea9.
  • Loading branch information...
1 parent f381ea9 commit 60a240bec0eec7cfbeb54d3f6e804409f68d509d Evan Schoenberg committed Mar 11, 2011
Showing 746 changed files with 33,570 additions and 0 deletions.
View
@@ -0,0 +1 @@
+*.pbxproj -crlf -diff -merge
View
@@ -0,0 +1,12 @@
+build
+*.xcodeproj/*.pbxuser
+*.xcodeproj/*.perspectivev3
+.DS_Store
+.swp
+~.nib
+.pbxuser
+.perspective
+*.perspectivev3
+*.mode1v3
+*.xcworkspacedata
+*.xcuserstate

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "AppSalesMobile.app"
+ BlueprintName = "AppSalesMobile"
+ ReferencedContainer = "container:AppSalesMobile.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ displayScaleIsEnabled = "NO"
+ displayScale = "1.00"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "AppSalesMobile.app"
+ BlueprintName = "AppSalesMobile"
+ ReferencedContainer = "container:AppSalesMobile.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ displayScaleIsEnabled = "NO"
+ displayScale = "1.00"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
+ BuildableName = "AppSalesMobile.app"
+ BlueprintName = "AppSalesMobile"
+ ReferencedContainer = "container:AppSalesMobile.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>AppSalesMobile.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>1D6058900D05DD3D006BFB54</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'AppSalesMobile' target in the 'AppSalesMobile' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+#endif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Binary file not shown.
@@ -0,0 +1,26 @@
+//
+// AbstractDayOrWeekController.h
+// AppSalesMobile
+//
+// Created by Evan Schoenberg on 1/29/09.
+// Copyright 2009 Adium X / Saltatory Software. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RootViewController;
+
+@interface AbstractDayOrWeekController : UITableViewController {
+ IBOutlet RootViewController *rootViewController;
+ NSMutableArray *daysByMonth;
+ float maxRevenue;
+ NSDateFormatter *sectionTitleFormatter;
+}
+
+@property (retain) NSMutableArray *daysByMonth;
+@property (assign) float maxRevenue;
+@property (retain) NSDateFormatter *sectionTitleFormatter;
+
+- (void)reload;
+
+@end
@@ -0,0 +1,87 @@
+//
+// AbstractDayOrWeekController.m
+// AppSalesMobile
+//
+// Created by Evan Schoenberg on 1/29/09.
+// Copyright 2009 Adium X / Saltatory Software. All rights reserved.
+//
+
+#import "AbstractDayOrWeekController.h"
+#import "Day.h"
+#import "DayCell.h"
+#import "CountriesController.h"
+#import "RootViewController.h"
+#import "CurrencyManager.h"
+#import "ReportManager.h"
+
+@implementation AbstractDayOrWeekController
+
+@synthesize daysByMonth, maxRevenue, sectionTitleFormatter;
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ daysByMonth = [NSMutableArray new];
+ sectionTitleFormatter = [NSDateFormatter new];
+ [sectionTitleFormatter setDateFormat:@"MMMM yyyy"];
+ self.maxRevenue = 0;
+ }
+ return self;
+}
+
+- (CGSize)contentSizeForViewInPopover
+{
+ return CGSizeMake(320, 480);
+}
+
+- (void)viewDidLoad
+{
+ self.tableView.rowHeight = 45.0;
+}
+
+- (void)reload
+{
+ [self.tableView reloadData];
+}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
+{
+ if (self.daysByMonth.count == 0)
+ return @"";
+
+ NSArray *sectionArray = [daysByMonth objectAtIndex:section];
+ if (sectionArray.count == 0)
+ return @"";
+
+ Day *firstDayInSection = [sectionArray objectAtIndex:0];
+ return [self.sectionTitleFormatter stringFromDate:firstDayInSection.date];
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ NSInteger count = self.daysByMonth.count;
+ return (count > 1 ? count : 1);
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ if (self.daysByMonth.count > 0) {
+ return [[self.daysByMonth objectAtIndex:section] count];
+ }
+ return 0;
+}
+
+- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ return YES;
+}
+
+- (void)dealloc
+{
+ self.sectionTitleFormatter = nil;
+ self.daysByMonth = nil;
+ [super dealloc];
+}
+
+@end
View
@@ -0,0 +1,38 @@
+//
+// App.h
+// AppSalesMobile
+//
+// Created by Ole Zorn on 11.09.09.
+// Copyright 2009 omz:software. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NSString* getDocPath(); // utility methods that belong in some other file
+NSString* getPrefetchedPath();
+
+@class Review;
+
+@interface App : NSObject <NSCoding> {
+ NSMutableArray *allAppNames;
+ NSString *appID;
+ NSString *appName;
+ NSMutableDictionary *reviewsByUser;
+ float averageStars;
+}
+
+@property (readonly) NSString *appID;
+@property (readonly) NSString *appName;
+@property (readonly) NSDictionary *reviewsByUser;
+@property (readonly) NSUInteger newReviewsCount;
+@property (readonly) NSArray *allAppNames;
+@property (readonly) float averageStars;
+
+- (id) initWithID:(NSString*)identifier name:(NSString*)name;
+- (void) addOrReplaceReview:(Review*)review;
+
+- (void) resetNewReviewCount;
+
+- (void) updateApplicationName:(NSString*)newAppName; // application names can change with new updates
+
+@end
View
@@ -0,0 +1,115 @@
+//
+// App.m
+// AppSalesMobile
+//
+// Created by Ole Zorn on 11.09.09.
+// Copyright 2009 omz:software. All rights reserved.
+//
+
+#import "App.h"
+#import "Review.h"
+
+NSString* getDocPath() {
+ static NSString *documentsDirectory = nil;
+ if (!documentsDirectory) {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ documentsDirectory = [[paths objectAtIndex:0] retain];
+ }
+ return documentsDirectory;
+}
+
+@implementation App
+
+@synthesize appID, appName, reviewsByUser, averageStars;
+
+- (id)initWithCoder:(NSCoder *)coder {
+ self = [super init];
+ if (self) {
+ appID = [[coder decodeObjectForKey:@"appID"] retain];
+ appName = [[coder decodeObjectForKey:@"appName"] retain];
+ reviewsByUser = [[coder decodeObjectForKey:@"reviewsByUser"] retain];
+ allAppNames = [[coder decodeObjectForKey:@"allAppNames"] retain];
+ averageStars = [coder decodeFloatForKey:@"averageStars"];
+ }
+ return self;
+}
+
+- (void) resetNewReviewCount {
+ for (Review *review in reviewsByUser.objectEnumerator) {
+ review.newOrUpdatedReview = NO;
+ }
+}
+
+- (NSArray*) allAppNames {
+ if(! allAppNames){
+ allAppNames = [[NSMutableArray alloc] initWithObjects:self.appName, nil];
+ }
+ return allAppNames;
+}
+
+- (void) updateApplicationName:(NSString*)n {
+ if(![n isEqualToString:appName]){
+ [appName release];
+ appName = [n retain];
+ }
+ for(NSString *name in self.allAppNames){
+ if([name isEqualToString:n])
+ return;
+ }
+ [allAppNames addObject:n];
+}
+
+- (id) initWithID:(NSString*)identifier name:(NSString*)name {
+ self = [super init];
+ if (self) {
+ appID = [identifier retain];
+ appName = [name retain];
+ reviewsByUser = [[NSMutableDictionary alloc] init];
+ }
+ return self;
+}
+
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeObject:self.appID forKey:@"appID"];
+ [coder encodeObject:self.appName forKey:@"appName"];
+ [coder encodeObject:self.reviewsByUser forKey:@"reviewsByUser"];
+ [coder encodeFloat:self.averageStars forKey:@"averageStars"];
+ [coder encodeObject:self.allAppNames forKey:@"allAppNames"];
+}
+
+- (NSString *) description {
+ return [NSString stringWithFormat:@"App %@ (%@)", self.appName, self.appID];
+}
+
+- (void) addOrReplaceReview:(Review*)review {
+ [reviewsByUser setObject:review forKey:review.user];
+
+ double sum = 0;
+ for (Review *r in reviewsByUser.allValues) {
+ sum += r.stars;
+ }
+ averageStars = sum / reviewsByUser.count;
+}
+
+- (NSUInteger) newReviewsCount {
+ NSUInteger newReviewsCount = 0;
+ for (Review *r in reviewsByUser.allValues) {
+ if (r.newOrUpdatedReview) {
+ newReviewsCount++;
+ }
+ }
+ return newReviewsCount;
+}
+
+- (void) dealloc
+{
+ [appID release];
+ [appName release];
+ [reviewsByUser release];
+ [allAppNames release];
+ [super dealloc];
+}
+
+@end
Oops, something went wrong.

0 comments on commit 60a240b

Please sign in to comment.