Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

(dev) Preventing occasional crash in TTURLRequestQueue :: createNSURLRequest:URL: #712

Closed
wants to merge 9 commits into from

6 participants

@ettore

Resubmitting this pull request ( #700 ) to development branch.

The crash happens because we're attempting to call NSURL :: URLWithString: with a request.urlPath == nil. I am aware that TTURLRequestQueue checks for blank urlPath's before queueing the request, but somehow this situation happens anyway. (Maybe during a memory warning cleanup?)

So I added a 2-liner sanity check to improve stability: this simply cancels the request in the case described above.

@ettore

I unintentionally added a somehow unrelated commit (63d03a1) solving build errors with iOS5/Xcode4.2. It doesn't look like it lets me remove it from this pull request, so if that's an issue, let me know if I should close this request and resubmit these 2 checkins as separate pull requests.

@ettore

I'm going to have to resubmit this pull request. Committed too much code to the same branch. Closing.

@ettore ettore closed this
@Dilip-Rajkumar

I really in need of your code. But I dont know how to checkout your version of code. I need to fix all the warnings before monday. Please help me. Thanks in advance..

Regards,
Dilip Rajkumar.

I'm still 27 warnings when building with iOS 5.

I have no warnings when I applied this.... I think you applied wrong!!
Thank you for the code..

Nice job man, I am looking for these for a long time.

Hello I create a new blank project in Xcode 4.2.1, i'm compile fine witout three20

I add three20 with script and showme 27 warnings and 0 errors, Build Succeeded

I substitue all content in three20 folder with your files buth now I have 27 warnings and 1 error:

Apple LLVM Compiler 3.0 Error:

fatal error: file '/Users/ferranlluctv/Desktop/three20/src/Three20Core/Headers/Three20Core_Prefix.pch' has been modified since the precompiled header was built

Can you helpme?

thanls a lot!

Where did you download the three20 frame work. Because this particular version of three20 will not have any warnings on ios5. However i guess its not merged with the main tree20.

I tried to apply your fixes but I don't really know how to get them into my copy of Three20. I did a "git://github.com/ettore/three20.git" and imported everything using the ttmodule.py script but none of the fixes are showing up.

Can anyone tell me what the proper way is?

Thank you

I never used the ttmodule.py script, I don't know what that does.

AFAIK the current development branch from facebook should already have all these fixes I believe? So I would try theirs first. Simply do a git checkout development after cloning the repository or just download the zip after switching to the development branch in github.

Otherwise, feel free to fork mine. Then switch to the "goodreads" branch (used to be called "development", I just renamed it.)

The development version fix all warnings! thanks

Can I publish app with developer of three20 version?

Thanks a lot!

@ettore

Dilip-Rajkumar, feel free to use my development branch:
https://github.com/ettore/three20/commits/development

Maybe the simplest thing is to simply download a zip file up to the commit you're interested?

You can always fork my Three20 tree, and then branch out from anywhere in case you need to add more custom stuff to it.

You can also cherry-pick that individual commit (man git-cherry-pick).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2011
  1. @ettore
Commits on Oct 26, 2011
  1. @ettore
Commits on Oct 27, 2011
  1. @ettore
  2. @ettore
  3. @ettore

    expose layoutTextEditor and showKeyboard methods to allow subclasses …

    ettore authored
    …to invoke them via super (needed by LLVM)
  4. @ettore
Commits on Nov 2, 2011
  1. @ettore

    set a reasonable default for a cell background color, since on iOS 5 …

    ettore authored
    …it would otherwise look very bland (same gray color used for grouped tableviews background)
  2. @ettore

    prevent crash on iOS 3.1.3 (UIDevice::userInterfaceIdiom not availabl…

    ettore authored
    …e). Using TTIsPad() function instead.
  3. @ettore

    added build phase to copy build products to ./Build/Products for ease…

    ettore authored
    … of access from project who's linking to Three20
This page is out of date. Refresh to see the latest.
Showing with 183 additions and 173 deletions.
  1. +17 −48 src/Three20/Three20.xcodeproj/project.pbxproj
  2. +5 −17 src/Three20Core/Three20Core.xcodeproj/project.pbxproj
  3. +5 −0 src/Three20Network/Headers/TTRequestLoader.h
  4. +97 −5 src/Three20Network/Sources/TTRequestLoader.m
  5. +3 −15 src/Three20Network/Three20Network.xcodeproj/project.pbxproj
  6. +2 −2 src/Three20Style/Sources/TTDefaultStyleSheet.m
  7. +3 −15 src/Three20Style/Three20Style.xcodeproj/project.pbxproj
  8. +4 −0 src/Three20UI/Headers/TTPostController.h
  9. +9 −9 src/Three20UI/Sources/TTMessageController.m
  10. +3 −3 src/Three20UI/Sources/TTModelViewController.m
  11. +1 −1  src/Three20UI/Sources/TTNavigator.m
  12. +2 −1  src/Three20UI/Sources/TTPhotoViewController.m
  13. +2 −2 src/Three20UI/Sources/TTPostController.m
  14. +1 −1  src/Three20UI/Sources/TTScrollView.m
  15. +1 −1  src/Three20UI/Sources/TTSearchTextField.m
  16. +7 −0 src/Three20UI/Sources/TTTableLinkedItemCell.m
  17. +2 −1  src/Three20UI/Sources/UITableViewAdditions.m
  18. +3 −15 src/Three20UI/Three20UI.xcodeproj/project.pbxproj
  19. +7 −5 src/Three20UICommon/Sources/TTGlobalUICommon.m
  20. +3 −15 src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj
  21. +2 −1  src/Three20UINavigator/Headers/TTBaseNavigator.h
  22. +1 −1  src/Three20UINavigator/Sources/UIViewController+TTNavigator.m
  23. +3 −15 src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj
View
65 src/Three20/Three20.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -20,20 +20,6 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
- 18C011EC13D5EE01006DFF7A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 662D81EF12630516005851C2;
- remoteInfo = "Three20Network-Xcode3.2.5";
- };
- 18C011EE13D5EE01006DFF7A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 662D81B2126304EB005851C2;
- remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5";
- };
66FC2E291265264C00F56B19 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
@@ -376,9 +362,7 @@
isa = PBXGroup;
children = (
6EE738A31184ADB400A35176 /* libThree20Network.a */,
- 18C011ED13D5EE01006DFF7A /* libThree20Network-Xcode3.2.5.a */,
6EE738A51184ADB400A35176 /* NetworkUnitTests.octest */,
- 18C011EF13D5EE01006DFF7A /* NetworkUnitTests-Xcode3.2.5.octest */,
);
name = Products;
sourceTree = "<group>";
@@ -407,6 +391,7 @@
BEF31F370F352DF5000DE5D2 /* Sources */,
668E6653131ADFFD00ACE4AB /* Lint */,
BEF31F380F352DF5000DE5D2 /* Frameworks */,
+ E55871171457D2A3000F5589 /* ShellScript */,
);
buildRules = (
);
@@ -455,9 +440,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -503,20 +489,6 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
- 18C011ED13D5EE01006DFF7A /* libThree20Network-Xcode3.2.5.a */ = {
- isa = PBXReferenceProxy;
- fileType = archive.ar;
- path = "libThree20Network-Xcode3.2.5.a";
- remoteRef = 18C011EC13D5EE01006DFF7A /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 18C011EF13D5EE01006DFF7A /* NetworkUnitTests-Xcode3.2.5.octest */ = {
- isa = PBXReferenceProxy;
- fileType = wrapper.cfbundle;
- path = "NetworkUnitTests-Xcode3.2.5.octest";
- remoteRef = 18C011EE13D5EE01006DFF7A /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
6E6454A71184D42800F08CB1 /* libThree20Style.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@@ -643,6 +615,19 @@
shellPath = "/bin/sh ../scripts/Protect.command";
shellScript = "";
};
+ E55871171457D2A3000F5589 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "cp ${BUILT_PRODUCTS_DIR}/* ${BUILD_DIR}/";
+ };
EB9E6C6010B6A8F800DE563C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -754,7 +739,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -769,10 +753,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
- SDKROOT = iphoneos;
};
name = Internal;
};
@@ -782,12 +764,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
@@ -802,9 +782,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
- SDKROOT = iphoneos;
};
name = Debug;
};
@@ -814,10 +792,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
- SDKROOT = iphoneos;
ZERO_LINK = NO;
};
name = Release;
@@ -830,7 +805,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -843,7 +817,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -854,12 +827,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
@@ -872,10 +843,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
PRODUCT_NAME = "$(BASE_PRODUCT_NAME)";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
View
22 src/Three20Core/Three20Core.xcodeproj/project.pbxproj
@@ -3,13 +3,13 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
+ 660E7375135A560A00531398 /* Three20Version.h in Headers */ = {isa = PBXBuildFile; fileRef = 660E7374135A560A00531398 /* Three20Version.h */; settings = {ATTRIBUTES = (Public, ); }; };
6656B2531354035900B34AB5 /* TTAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 6656B2521354035900B34AB5 /* TTAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
6656B2551354035F00B34AB5 /* TTAvailability.m in Sources */ = {isa = PBXBuildFile; fileRef = 6656B2541354035F00B34AB5 /* TTAvailability.m */; };
- 660E7375135A560A00531398 /* Three20Version.h in Headers */ = {isa = PBXBuildFile; fileRef = 660E7374135A560A00531398 /* Three20Version.h */; settings = {ATTRIBUTES = (Public, ); }; };
66A0530A132EB47900132434 /* Three20.m in Sources */ = {isa = PBXBuildFile; fileRef = 66A05309132EB47900132434 /* Three20.m */; };
66A0530C132EB47F00132434 /* Three20.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A0530B132EB47F00132434 /* Three20.h */; settings = {ATTRIBUTES = (Public, ); }; };
66ADC9091290B23A00855386 /* TTExtensionInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 66ADC9071290B23A00855386 /* TTExtensionInfo.m */; };
@@ -69,9 +69,9 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 660E7374135A560A00531398 /* Three20Version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Three20Version.h; path = Headers/Three20Version.h; sourceTree = "<group>"; };
6656B2521354035900B34AB5 /* TTAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TTAvailability.h; path = Headers/TTAvailability.h; sourceTree = "<group>"; };
6656B2541354035F00B34AB5 /* TTAvailability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TTAvailability.m; path = Sources/TTAvailability.m; sourceTree = "<group>"; };
- 660E7374135A560A00531398 /* Three20Version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Three20Version.h; path = Headers/Three20Version.h; sourceTree = "<group>"; };
66A05309132EB47900132434 /* Three20.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Three20.m; path = Sources/Three20.m; sourceTree = "<group>"; };
66A0530B132EB47F00132434 /* Three20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Three20.h; path = Headers/Three20.h; sourceTree = "<group>"; };
66ADC9071290B23A00855386 /* TTExtensionInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TTExtensionInfo.m; path = Sources/TTExtensionInfo.m; sourceTree = "<group>"; };
@@ -406,9 +406,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Core" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -539,7 +540,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -554,7 +554,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -566,12 +565,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -584,7 +581,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -595,8 +591,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -610,7 +604,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -624,7 +617,6 @@
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -635,12 +627,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -651,10 +641,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
View
5 src/Three20Network/Headers/TTRequestLoader.h
@@ -56,6 +56,11 @@
* When load requests fail we'll attempt the request again, as many as 2 times by default.
*/
int _retriesLeft;
+
+ /**
+ * Alert shown if the request is configured with a max download cap.
+ */
+ id _cancelAlert;
}
/**
View
102 src/Three20Network/Sources/TTRequestLoader.m
@@ -37,6 +37,51 @@
static const NSInteger kLoadMaxRetries = 2;
+@interface TTRequestLoader ()
+- (void)resetCancelLoadingState;
+- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSHTTPURLResponse*)response;
+- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data;
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
+@end
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////////////////
+@interface AlertDelegate : NSObject<UIAlertViewDelegate>
+{
+ TTRequestLoader *mLoader;
+}
+-(id)initWithLoader:(TTRequestLoader*)loader;
+@end
+
+@implementation AlertDelegate
+
+-(id)initWithLoader:(TTRequestLoader*)loader;
+{
+ if ((self = [super init])) {
+ mLoader = [loader retain];
+ }
+ return self;
+}
+
+- (void)alertView:(UIAlertView*)alert clickedButtonAtIndex:(NSInteger)idx
+{
+ if (idx != 0) {
+ [mLoader cancel];
+ }
+ [alert release];
+ [mLoader resetCancelLoadingState];
+ [self autorelease];
+}
+
+-(void)dealloc
+{
+ [mLoader release];
+ [super dealloc];
+}
+@end
+
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -100,7 +145,8 @@ - (void)deliverDataResponse:(NSURL*)URL {
// Strictly speaking, to be really conformant need to interpret %xx hex encoded entities.
// The [NSString dataUsingEncoding] doesn't do that correctly, but most documents don't use that.
// Skip for now.
- _responseData = [[[dataSplit objectAtIndex:1] dataUsingEncoding:NSASCIIStringEncoding] retain];
+ NSData *d = [[dataSplit objectAtIndex:1] dataUsingEncoding:NSASCIIStringEncoding];
+ _responseData = [[NSMutableData dataWithData:d] retain];
} else {
_responseData = [[NSData dataWithBase64EncodedString:[dataSplit objectAtIndex:1]] retain];
}
@@ -120,6 +166,13 @@ - (void)connectToURL:(NSURL*)URL {
TTNetworkRequestStarted();
TTURLRequest* request = _requests.count == 1 ? [_requests objectAtIndex:0] : nil;
+
+ // there are situations where urlPath is somehow nil (therefore crashing in
+ // createNSURLRequest:URL:, even if we checked for non-blank values before
+ // adding the request to the queue.
+ if (!request.urlPath.length)
+ [self cancel:request];
+
NSURLRequest* URLRequest = [_queue createNSURLRequest:request URL:URL];
_connection = [[NSURLConnection alloc] initWithRequest:URLRequest delegate:self];
@@ -140,6 +193,33 @@ - (void)dispatchLoadedBytes:(NSInteger)bytesLoaded expected:(NSInteger)bytesExpe
}
}
+#pragma mark Alert messaging when download is bigger than max allowed
+
+-(void)showMaxContentAlert
+{
+ AlertDelegate *deleg = [[AlertDelegate alloc] initWithLoader:self];
+ NSString *t, *m, *b0, *b1;
+ NSBundle *bndl = [NSBundle mainBundle];
+
+ m = @"It could take a while to download this content. Do you want to continue?";
+ m = [bndl localizedStringForKey:m value:m table:nil];
+ t = [bndl localizedStringForKey:@"Warning" value:@"Warning" table:nil];
+ b0= [bndl localizedStringForKey:@"Continue" value:@"Continue" table:nil];
+ b1= [bndl localizedStringForKey:@"Abort Download" value:@"Abort Download" table:nil];
+
+ _cancelAlert = [[UIAlertView alloc] initWithTitle:t
+ message:m
+ delegate:deleg
+ cancelButtonTitle:b0
+ otherButtonTitles:b1, nil];
+ [_cancelAlert show];
+}
+
+-(void)resetCancelLoadingState
+{
+ _cancelAlert = nil;
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -335,12 +415,19 @@ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSHTTPURLRes
// method. Setting the max content length to zero allows anything to go through. If you just
// want to raise the limit, set it to any positive byte size.
// [[TTURLRequestQueue mainQueue] setMaxContentLength:0]
- TTDASSERT(0 == _queue.maxContentLength || contentLength <=_queue.maxContentLength);
+ //TTDASSERT(0 == _queue.maxContentLength || contentLength <=_queue.maxContentLength);
+ TTDPRINT(@"contentLength=%d", contentLength);
if (contentLength > _queue.maxContentLength && _queue.maxContentLength) {
- TTDCONDITIONLOG(TTDFLAG_URLREQUEST, @"MAX CONTENT LENGTH EXCEEDED (%d) %@",
- contentLength, _urlPath);
- [self cancel];
+ // instead of unilaterally cancelling the download, show a dialog to let the
+ // user decide. While the user decides, the download starts anyway.
+ [self performSelectorOnMainThread:@selector(showMaxContentAlert)
+ withObject:nil
+ waitUntilDone:YES];
+
+// TTDCONDITIONLOG(TTDFLAG_URLREQUEST, @"MAX CONTENT LENGTH EXCEEDED (%d) %@",
+// contentLength, _urlPath);
+// [self cancel];
}
_responseData = [[NSMutableData alloc] initWithCapacity:contentLength];
@@ -379,6 +466,11 @@ - (void) connection: (NSURLConnection *)connection
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
+ if (_cancelAlert) {
+ [_cancelAlert dismissWithClickedButtonIndex:1 animated:YES];
+ [self resetCancelLoadingState];
+ }
+
TTNetworkRequestStopped();
TTDCONDITIONLOG(TTDFLAG_ETAGS, @"Response status code: %d", _response.statusCode);
View
18 src/Three20Network/Three20Network.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -436,9 +436,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Network" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -583,7 +584,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -596,7 +596,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -608,12 +607,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -626,7 +623,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -637,8 +633,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -652,7 +646,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -665,7 +658,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -676,12 +668,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -692,10 +682,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
View
4 src/Three20Style/Sources/TTDefaultStyleSheet.m
@@ -743,7 +743,7 @@ - (UIColor*)highlightedTextColor {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIColor*)backgroundTextColor {
- return [UIColor whiteColor];
+ return [UIColor clearColor];
}
@@ -755,7 +755,7 @@ - (UIFont*)font {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIColor*)backgroundColor {
- return [UIColor whiteColor];
+ return [UIColor clearColor];
}
View
18 src/Three20Style/Three20Style.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -858,9 +858,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Style" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -1090,7 +1091,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -1105,7 +1105,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -1122,13 +1121,11 @@
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -1142,7 +1139,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -1153,8 +1149,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -1168,7 +1162,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -1181,7 +1174,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -1197,12 +1189,10 @@
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -1219,11 +1209,9 @@
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
);
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
HEADER_SEARCH_PATHS = .;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
ZERO_LINK = NO;
View
4 src/Three20UI/Headers/TTPostController.h
@@ -85,4 +85,8 @@
- (NSString*)titleForError:(NSError*)error;
+- (void)layoutTextEditor;
+
+- (void)showKeyboard;
+
@end
View
18 src/Three20UI/Sources/TTMessageController.m
@@ -422,7 +422,7 @@ - (BOOL)persistView:(NSMutableDictionary*)state {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)restoreView:(NSDictionary*)state {
- self.view;
+ [self view];
TT_RELEASE_SAFELY(_initialRecipients);
NSMutableArray* fields = [state objectForKey:@"fields"];
for (NSInteger i = 0; i < fields.count; ++i) {
@@ -539,7 +539,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)subject {
- self.view;
+ [self view];
for (int i = 0; i < _fields.count; ++i) {
id field = [_fields objectAtIndex:i];
if ([field isKindOfClass:[TTMessageSubjectField class]]) {
@@ -553,7 +553,7 @@ - (NSString*)subject {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setSubject:(NSString*)subject {
- self.view;
+ [self view];
for (int i = 0; i < _fields.count; ++i) {
id field = [_fields objectAtIndex:i];
if ([field isKindOfClass:[TTMessageSubjectField class]]) {
@@ -573,7 +573,7 @@ - (NSString*)body {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setBody:(NSString*)body {
- self.view;
+ [self view];
_textEditor.text = body;
}
@@ -609,7 +609,7 @@ - (void)setFields:(NSArray*)fields {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)addRecipient:(id)recipient forFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
TTPickerTextField* textField = [_fieldViews objectAtIndex:fieldIndex];
if ([textField isKindOfClass:[TTPickerTextField class]]) {
NSString* label = [_dataSource tableView:textField.tableView labelForObject:recipient];
@@ -622,7 +622,7 @@ - (void)addRecipient:(id)recipient forFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)textForFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
NSString* text = nil;
if (fieldIndex == _fieldViews.count) {
@@ -642,7 +642,7 @@ - (NSString*)textForFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setText:(NSString*)text forFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
_textEditor.text = text;
@@ -657,7 +657,7 @@ - (void)setText:(NSString*)text forFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (BOOL)fieldHasValueAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
return _textEditor.text.length > 0;
@@ -681,7 +681,7 @@ - (BOOL)fieldHasValueAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIView*)viewForFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
return _textEditor;
View
6 src/Three20UI/Sources/TTModelViewController.m
@@ -377,7 +377,7 @@ - (void)invalidateModel {
[_model.delegates removeObject:self];
TT_RELEASE_SAFELY(_model);
if (wasModelCreated) {
- self.model;
+ [self model];
}
}
@@ -480,9 +480,9 @@ - (void)updateView {
_flags.isUpdatingView = YES;
// Ensure the model is created
- self.model;
+ [self model];
// Ensure the view is created
- self.view;
+ [self view];
[self updateViewStates];
View
2  src/Three20UI/Sources/TTNavigator.m
@@ -139,7 +139,7 @@ - (void)presentDependantController: (UIViewController*)controller
- (void)didRestoreController:(UIViewController*)controller {
if ([controller isKindOfClass:[TTModelViewController class]]) {
TTModelViewController* modelViewController = (TTModelViewController*)controller;
- modelViewController.model;
+ [modelViewController model];
}
}
View
3  src/Three20UI/Sources/TTPhotoViewController.m
@@ -379,7 +379,8 @@ - (void)showThumbnails {
// The photo source has a URL mapping in TTURLMap, so we use that to show the thumbs
NSDictionary* query = [NSDictionary dictionaryWithObject:self forKey:@"delegate"];
TTBaseNavigator* navigator = [TTBaseNavigator navigatorForView:self.view];
- _thumbsController = [[navigator viewControllerForURL:URL query:query] retain];
+ _thumbsController = (TTThumbsViewController*)[navigator viewControllerForURL:URL query:query];
+ [_thumbsController retain];
[navigator.URLMap setObject:_thumbsController forURL:URL];
} else {
View
4 src/Three20UI/Sources/TTPostController.m
@@ -478,7 +478,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UITextView*)textView {
- self.view;
+ [self view];
return _textView;
}
@@ -486,7 +486,7 @@ - (UITextView*)textView {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UINavigationBar*)navigatorBar {
if (!_navigationBar) {
- self.view;
+ [self view];
}
return _navigationBar;
}
View
2  src/Three20UI/Sources/TTScrollView.m
@@ -85,7 +85,7 @@ - (id)initWithFrame:(CGRect)frame {
_scrollEnabled = YES;
_zoomEnabled = YES;
_rotateEnabled = YES;
- _orientation = UIDeviceOrientationPortrait;
+ _orientation = (UIInterfaceOrientation)UIDeviceOrientationPortrait;
_decelerationRate = 0.9; // Inertia, how faster slow the residual movement.
_maximumZoomScale = 4.0; // Maximum zoom scale default value.
_centerPageAnimationDuration = TT_TRANSITION_DURATION;
View
2  src/Three20UI/Sources/TTSearchTextField.m
@@ -419,7 +419,7 @@ - (void)search {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)showSearchResults:(BOOL)show {
if (show && _dataSource) {
- self.tableView;
+ [self tableView];
if (!_shadowView) {
_shadowView = [[TTView alloc] init];
View
7 src/Three20UI/Sources/TTTableLinkedItemCell.m
@@ -58,6 +58,13 @@ - (id)object {
///////////////////////////////////////////////////////////////////////////////////////////////////
+- (void)layoutSubviews {
+ [super layoutSubviews];
+ [self setBackgroundColor:[UIColor whiteColor]];
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setObject:(id)object {
if (_item != object) {
[_item release];
View
3  src/Three20UI/Sources/UITableViewAdditions.m
@@ -24,6 +24,7 @@
// UICommon
#import "Three20UICommon/UIWindowAdditions.h"
+#import "Three20UICommon/TTGlobalUICommon.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -53,7 +54,7 @@ - (UIView*)indexView {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (CGFloat)tableCellMargin {
if (self.style == UITableViewStyleGrouped) {
- if (([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)) {
+ if (TTIsPad()) {
return 45.0;
}
else {
View
18 src/Three20UI/Three20UI.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -1938,9 +1938,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UI" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -2319,7 +2320,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -2334,7 +2334,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -2346,13 +2345,11 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -2366,7 +2363,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -2377,8 +2373,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -2392,7 +2386,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -2405,7 +2398,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -2416,12 +2408,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -2433,10 +2423,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
ZERO_LINK = NO;
View
12 src/Three20UICommon/Sources/TTGlobalUICommon.m
@@ -113,12 +113,14 @@ BOOL TTIsPad() {
///////////////////////////////////////////////////////////////////////////////////////////////////
UIDeviceOrientation TTDeviceOrientation() {
- UIDeviceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
- if (UIDeviceOrientationUnknown == orient) {
+ UIDeviceOrientation o;
+ o = (UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation;
+
+ if (UIDeviceOrientationUnknown == o) {
return UIDeviceOrientationPortrait;
} else {
- return orient;
+ return o;
}
}
@@ -159,7 +161,7 @@ BOOL TTDeviceOrientationIsLandscape() {
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding];
free(machine);
-
+
if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
@@ -174,7 +176,7 @@ BOOL TTDeviceOrientationIsLandscape() {
if ([platform isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)";
if ([platform isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"i386"]) return @"Simulator";
-
+
return platform;
}
View
18 src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -298,9 +298,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UICommon" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -449,7 +450,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -464,7 +464,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -476,13 +475,11 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -496,7 +493,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -507,8 +503,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -522,7 +516,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -535,7 +528,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -546,12 +538,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -563,10 +553,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
ZERO_LINK = NO;
View
3  src/Three20UINavigator/Headers/TTBaseNavigator.h
@@ -24,6 +24,7 @@
@class TTURLAction;
@class TTURLMap;
@class TTURLPattern;
+@class TTURLNavigatorPattern;
/**
* A URL-based navigation system with built-in persistence.
@@ -223,7 +224,7 @@
* @return The view controller mapped to URL.
*/
- (UIViewController*)viewControllerForURL:(NSString*)URL query:(NSDictionary*)query
- pattern:(TTURLPattern**)pattern;
+ pattern:(TTURLNavigatorPattern**)pattern;
/**
* Tells the navigator to delay heavy operations.
View
2  src/Three20UINavigator/Sources/UIViewController+TTNavigator.m
@@ -37,7 +37,7 @@
static NSMutableSet* gsNavigatorControllers = nil;
static NSTimer* gsGarbageCollectorTimer = nil;
-static const NSTimeInterval kGarbageCollectionInterval = 20;
+static const NSTimeInterval kGarbageCollectionInterval = 5;
///////////////////////////////////////////////////////////////////////////////////////////////////
View
18 src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -508,9 +508,10 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UINavigator" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -696,7 +697,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Internal;
@@ -711,7 +711,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
@@ -723,13 +722,11 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -743,7 +740,6 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -754,8 +750,6 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PREBINDING = NO;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
@@ -769,7 +763,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Debug;
@@ -782,7 +775,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OTHER_LDFLAGS = "-ObjC";
- PREBINDING = NO;
SDKROOT = iphoneos;
};
name = Release;
@@ -793,12 +785,10 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
};
@@ -810,10 +800,8 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- PREBINDING = NO;
SDKROOT = iphoneos;
WRAPPER_EXTENSION = octest;
ZERO_LINK = NO;
Something went wrong with that request. Please try again.