Permalink
Browse files

Experimental support for showing delays in iTunes Connect

  • Loading branch information...
1 parent 49cf941 commit 64e89e976bee8c2e160c3008514cb24c31b5d84c Ole Zorn committed Oct 8, 2009
@@ -19,6 +19,7 @@
7F17E0570ED4F21E0005D8AF /* CurrencySelectionDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F17E0560ED4F21E0005D8AF /* CurrencySelectionDialog.m */; };
7F29EA420ED861B20018C18A /* help in Resources */ = {isa = PBXBuildFile; fileRef = 7F29EA340ED861B20018C18A /* help */; };
7F29EA630ED861CE0018C18A /* HelpBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F29EA620ED861CE0018C18A /* HelpBrowser.m */; };
+ 7F47897810661CBD002415A2 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7F47897710661CBD002415A2 /* Entitlements.plist */; };
7F4C218810230EF300F17F7D /* About.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F4C217610230EF200F17F7D /* About.png */; };
7F4C218910230EF300F17F7D /* Daily.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F4C217710230EF200F17F7D /* Daily.png */; };
7F4C218A10230EF300F17F7D /* DateButtonHighlight.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F4C217810230EF200F17F7D /* DateButtonHighlight.png */; };
@@ -312,6 +313,7 @@
7F29EA340ED861B20018C18A /* help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = help; sourceTree = "<group>"; };
7F29EA610ED861CE0018C18A /* HelpBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpBrowser.h; sourceTree = "<group>"; };
7F29EA620ED861CE0018C18A /* HelpBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpBrowser.m; sourceTree = "<group>"; };
+ 7F47897710661CBD002415A2 /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = "<group>"; };
7F4C217610230EF200F17F7D /* About.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = About.png; sourceTree = "<group>"; };
7F4C217710230EF200F17F7D /* Daily.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Daily.png; sourceTree = "<group>"; };
7F4C217810230EF200F17F7D /* DateButtonHighlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DateButtonHighlight.png; sourceTree = "<group>"; };
@@ -664,6 +666,7 @@
7FB0C4430EB97BE8005E2C45 /* libz.dylib */,
7F87BC9B0ED9B588001C8BC8 /* Security.framework */,
7FB391980EE7991D00AC30D5 /* SystemConfiguration.framework */,
+ 7F47897710661CBD002415A2 /* Entitlements.plist */,
);
name = CustomTemplate;
sourceTree = "<group>";
@@ -1392,6 +1395,7 @@
7FEA5AA9105B61CD000A12E6 /* 5stars.png in Resources */,
7FEA5B40105B6CD2000A12E6 /* ReviewTemplate.html in Resources */,
7FEA5C2C105C1A57000A12E6 /* 5stars_gray.png in Resources */,
+ 7F47897810661CBD002415A2 /* Entitlements.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1468,13 +1472,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = AppSalesMobile_Prefix.pch;
INFOPLIST_FILE = Info.plist;
PRODUCT_NAME = AppSalesMobile;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
};
name = Debug;
};
@@ -1537,12 +1543,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Ole Zorn";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
PRODUCT_NAME = AppSales;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "E93F46E8-449F-4589-BF04-18A8FC9714F2";
SDKROOT = iphoneos3.0;
};
name = Release;
@@ -30,6 +30,7 @@
#import "AppSalesMobileAppDelegate.h"
#import "RootViewController.h"
+#import "Day.h"
@implementation AppSalesMobileAppDelegate
View
@@ -32,7 +32,7 @@
@class Country;
@interface Day : NSObject {
- NSLock *lock_countries;
+ //NSLock *lock_countries;
NSMutableDictionary *countries;
NSDate *date;
NSString *cachedWeekEndDateString;
@@ -45,16 +45,15 @@
NSString *name;
}
-@property (retain) NSLock *lock_countries;
-@property (retain) NSDate *date;
-@property (retain) NSMutableDictionary *countries;
-@property (retain) NSString *cachedWeekEndDateString;
-@property (retain) UIColor *cachedWeekDayColor;
-@property (retain) NSString *cachedDayString;
-@property (assign) BOOL isWeek;
-@property (assign) BOOL wasLoadedFromDisk;
-@property (retain) NSString *name;
-@property (retain) NSString *pathOnDisk;
+@property (nonatomic, retain) NSDate *date;
+@property (nonatomic, retain) NSMutableDictionary *countries;
+@property (nonatomic, retain) NSString *cachedWeekEndDateString;
+@property (nonatomic, retain) UIColor *cachedWeekDayColor;
+@property (nonatomic, retain) NSString *cachedDayString;
+@property (nonatomic, assign) BOOL isWeek;
+@property (nonatomic, assign) BOOL wasLoadedFromDisk;
+@property (nonatomic, retain) NSString *name;
+@property (nonatomic, retain) NSString *pathOnDisk;
+ (Day *)dayFromFile:(NSString *)filename atPath:(NSString *)docPath;
View
@@ -45,16 +45,15 @@ @implementation Day
@synthesize wasLoadedFromDisk;
@synthesize name;
@synthesize pathOnDisk;
-@synthesize lock_countries;;
- (id)init
{
- if ((self = [super init])) {
- self.lock_countries = [[[NSLock alloc] init] autorelease];
+ if (self = [super init]) {
}
return self;
}
+
- (id)initWithCSV:(NSString *)csv
{
[self init];
@@ -66,8 +65,10 @@ - (id)initWithCSV:(NSString *)csv
NSMutableArray *lines = [[[csv componentsSeparatedByString:@"\n"] mutableCopy] autorelease];
if ([lines count] > 0)
[lines removeObjectAtIndex:0];
- if ([lines count] < 1)
+ if ([lines count] == 0) {
+ [self release];
return nil; //sanity check
+ }
for (NSString *line in lines) {
NSArray *columns = [line componentsSeparatedByString:@"\t"];
@@ -107,8 +108,11 @@ - (id)initWithCSV:(NSString *)csv
country:country] autorelease]; //gets added to the countries entry list automatically
entry.productIdentifier = appId;
}
+ else {
+ [self release];
+ return nil;
+ }
}
-
return self;
}
@@ -143,8 +147,6 @@ + (Day *)dayFromFile:(NSString *)filename atPath:(NSString *)docPath;
shouldLoadCountries = NO;
Day *loadedDay = [NSKeyedUnarchiver unarchiveObjectWithFile:fullPath];
shouldLoadCountries = YES;
-
- /* Will load the countries (and the entries they contain) lazily as necessary from fullPath */
loadedDay.pathOnDisk = fullPath;
return loadedDay;
@@ -153,23 +155,11 @@ + (Day *)dayFromFile:(NSString *)filename atPath:(NSString *)docPath;
- (NSMutableDictionary *)countries
{
if (self.pathOnDisk && !countries) {
- [lock_countries lock];
- /* Countries may have been assigned while the lock was being acquired, on another thread.
- * Note that we can't depend upon the atomicity of properties here because we're assigning the property
- * being accessed from within the accessor (lazy assignment).
- */
- if (!countries) {
+ if (!countries) {
countries = [((Day *)[NSKeyedUnarchiver unarchiveObjectWithFile:self.pathOnDisk]).countries retain];
self.pathOnDisk = nil;
- if (self.isWeek) {
- //NSLog(@"Week %@: %@", self.name, [self totalRevenueString]);
- } else {
- //NSLog(@"Day %@: %@", self.name, [self totalRevenueString]);
- }
}
- [lock_countries unlock];
}
-
return countries;
}
@@ -381,7 +371,7 @@ - (void)dealloc
self.date = nil;
self.name = nil;
self.pathOnDisk = nil;
- self.lock_countries = nil;
+ //self.lock_countries = nil;
[super dealloc];
}
@@ -260,6 +260,14 @@ - (void)fetchReportsWithUserInfo:(NSDictionary *)userInfo
return;
}
+ NSString *errorMessageString = nil;
+ [scanner setScanLocation:0];
+ BOOL errorMessagePresent = [scanner scanUpToString:@"<font color=\"red\">" intoString:NULL];
+ if (errorMessagePresent) {
+ [scanner scanString:@"<font color=\"red\">" intoString:NULL];
+ [scanner scanUpToString:@"</font>" intoString:&errorMessageString];
+ }
+
for (int i=0; i<=1; i++) {
NSString *downloadType;
NSString *downloadActionName;
@@ -296,9 +304,9 @@ - (void)fetchReportsWithUserInfo:(NSDictionary *)userInfo
BOOL scannedDay = YES;
while (scannedDay) {
NSString *dayString = nil;
- /*scannedDay =*/ [scanner scanUpToString:@"<option value=\"" intoString:NULL];
- /*scannedDay =*/ [scanner scanString:@"<option value=\"" intoString:NULL];
- /*scannedDay =*/ [scanner scanUpToString:@"\"" intoString:&dayString];
+ [scanner scanUpToString:@"<option value=\"" intoString:NULL];
+ [scanner scanString:@"<option value=\"" intoString:NULL];
+ [scanner scanUpToString:@"\"" intoString:&dayString];
if (dayString) {
if ([dayString rangeOfString:@"/"].location != NSNotFound)
[availableDays addObject:dayString];
@@ -377,6 +385,9 @@ - (void)fetchReportsWithUserInfo:(NSDictionary *)userInfo
}
[self performSelectorOnMainThread:@selector(setProgress:) withObject:@"" waitUntilDone:YES];
+ if (errorMessageString) {
+ [self performSelectorOnMainThread:@selector(presentErrorMessage:) withObject:errorMessageString waitUntilDone:YES];
+ }
[pool release];
}
@@ -388,6 +399,12 @@ - (void)downloadFailed
[alert show];
}
+- (void)presentErrorMessage:(NSString *)message
+{
+ UIAlertView *errorAlert = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Note",nil) message:message delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil] autorelease];
+ [errorAlert show];
+}
+
- (void)successfullyDownloadedDays:(NSDictionary *)newDays
{
[days addEntriesFromDictionary:newDays];
View
@@ -0,0 +1,8 @@
+<?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>get-task-allow</key>
+ <false/>
+</dict>
+</plist>
Binary file not shown.

0 comments on commit 64e89e9

Please sign in to comment.