diff --git a/Classes/ReceiveViewController.m b/Classes/ReceiveViewController.m index df85c0c..0dcff7c 100644 --- a/Classes/ReceiveViewController.m +++ b/Classes/ReceiveViewController.m @@ -12,14 +12,13 @@ @implementation ReceiveViewController - (id)init { - [super initWithNibName:nil bundle:nil]; + if (!(self = [super initWithNibName:nil bundle:nil])) return nil; UITabBarItem *tbi = [self tabBarItem]; [tbi setTitle:@"Receive URL"]; UIImage *image = [UIImage imageNamed:@"receive.png"]; [tbi setImage:image]; - [image release]; return self; } @@ -37,38 +36,4 @@ - (void)setReceivedURL:(NSURL *)url [urlTextView setText:[url absoluteString]]; } -/* -// 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 { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (void)dealloc { - [super dealloc]; -} - - @end diff --git a/Classes/SendViewController.h b/Classes/SendViewController.h index 1df55a0..8fd33a6 100644 --- a/Classes/SendViewController.h +++ b/Classes/SendViewController.h @@ -16,6 +16,7 @@ IBOutlet UITextField *parametersField; IBOutlet UITextField *callbackField; IBOutlet UITextField *errorCallbackField; + IBOutlet UITextField *cancelCallbackField; IBOutlet UITextField *sourceField; } diff --git a/Classes/SendViewController.m b/Classes/SendViewController.m index a9f3506..14a24e7 100644 --- a/Classes/SendViewController.m +++ b/Classes/SendViewController.m @@ -12,14 +12,13 @@ @implementation SendViewController - (id)init { - [super initWithNibName:nil bundle:nil]; + if (!(self = [super initWithNibName:nil bundle:nil])) return nil; UITabBarItem *tbi = [self tabBarItem]; [tbi setTitle:@"Send URL"]; UIImage *image = [UIImage imageNamed:@"send.png"]; [tbi setImage:image]; - [image release]; return self; } @@ -28,20 +27,14 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil return [self init]; } - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; -} - - (NSString *)encodeString:(NSString *)str { - return (NSString *)CFURLCreateStringByAddingPercentEscapes( + return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes( NULL, (CFStringRef)str, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]", - kCFStringEncodingUTF8 ); + kCFStringEncodingUTF8 )); } - (BOOL)canOpenURL @@ -65,7 +58,6 @@ -(void)openURL cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; - [alertView release]; return; } @@ -90,12 +82,18 @@ -(void)openURL urlString = [urlString stringByAppendingString:@"x-error="]; urlString = [urlString stringByAppendingString:[self encodeString:[errorCallbackField text]]]; urlString = [urlString stringByAppendingString:@"&"]; - } + } + if ([[cancelCallbackField text] length] > 0) { + urlString = [urlString stringByAppendingString:@"x-cancel="]; + urlString = [urlString stringByAppendingString:[self encodeString:[cancelCallbackField text]]]; + urlString = [urlString stringByAppendingString:@"&"]; + } if ([[sourceField text] length] > 0) { urlString = [urlString stringByAppendingString:@"x-source="]; urlString = [urlString stringByAppendingString:[self encodeString:[sourceField text]]]; urlString = [urlString stringByAppendingString:@"&"]; } + urlString = [urlString stringByAppendingString:[parametersField text]]; @@ -108,8 +106,6 @@ -(void)openURL NSLog(@"Unable to open url"); } - [url release]; - [urlString release]; } - (BOOL)textFieldShouldReturn:(UITextField *)textField @@ -123,36 +119,4 @@ - (void)textFieldDidEndEditing:(UITextField *)textField [textField resignFirstResponder]; } -/* -// 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 { - [super viewDidUnload]; - [schemeField release]; - [hostField release]; - [actionField release]; - [parametersField release]; - [callbackField release]; - [errorCallbackField release]; - [sourceField release]; -} - - -- (void)dealloc { - [super dealloc]; -} - - @end diff --git a/Classes/SendViewController.xib b/Classes/SendViewController.xib index 868ad2c..83237e8 100644 --- a/Classes/SendViewController.xib +++ b/Classes/SendViewController.xib @@ -1,33 +1,30 @@ - 1056 - 10J567 - 1305 - 1038.35 - 462.00 + 1552 + 12D78 + 3084 + 1187.37 + 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 300 + 2083 YES - IBUITextField + IBProxyObject IBUIButton - IBUIView IBUILabel - IBProxyObject + IBUITextField + IBUIView YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin - YES - - YES - - + PluginDependencyRecalculationVersion + YES @@ -47,20 +44,16 @@ 292 - {{20, 40}, {45, 21}} + {{20, 2}, {45, 21}} + NO YES 7 NO IBCocoaTouchFramework Scheme - - Helvetica - 12 - 16 - 3 MC4zMzMzMzMzMzMzAA @@ -71,49 +64,65 @@ 1 10 + + Helvetica + Helvetica + 0 + 12 + + + Helvetica + 12 + 16 + 292 - {{20, 89}, {45, 21}} + {{20, 51}, {45, 21}} + NO YES 7 NO IBCocoaTouchFramework Action - 1 10 + + 292 - {{99, 40}, {45, 21}} + {{99, 2}, {45, 21}} + NO YES 7 NO IBCocoaTouchFramework Host - 1 10 + + 292 - {{20, 60}, {71, 31}} + {{20, 22}, {71, 31}} + NO YES IBCocoaTouchFramework @@ -134,13 +143,19 @@ IBCocoaTouchFramework 1 + + 1 + 12 + + 292 - {{99, 60}, {201, 31}} + {{99, 22}, {201, 31}} + NO YES IBCocoaTouchFramework @@ -159,13 +174,16 @@ IBCocoaTouchFramework 1 + + 292 - {{20, 109}, {280, 31}} + {{20, 71}, {280, 31}} + NO YES IBCocoaTouchFramework @@ -184,31 +202,36 @@ IBCocoaTouchFramework 1 + + 292 - {{20, 140}, {111, 21}} + {{20, 102}, {111, 21}} + NO YES 7 NO IBCocoaTouchFramework Action Parameters - 1 10 + + 292 - {{20, 160}, {280, 31}} + {{20, 122}, {280, 31}} + NO YES IBCocoaTouchFramework @@ -227,31 +250,36 @@ IBCocoaTouchFramework 1 + + 292 - {{20, 190}, {54, 21}} + {{20, 152}, {54, 21}} + NO YES 7 NO IBCocoaTouchFramework x-success - 1 10 + + 292 - {{20, 210}, {280, 31}} + {{20, 172}, {280, 31}} + NO YES IBCocoaTouchFramework @@ -270,31 +298,36 @@ IBCocoaTouchFramework 1 + + 292 - {{20, 239}, {54, 21}} + {{20, 201}, {54, 21}} + NO YES 7 NO IBCocoaTouchFramework x-error - 1 10 + + 292 - {{20, 259}, {280, 31}} + {{20, 221}, {280, 31}} + NO YES IBCocoaTouchFramework @@ -313,31 +346,36 @@ IBCocoaTouchFramework 1 + + 292 - {{20, 287}, {54, 21}} + {{20, 303}, {54, 21}} + NO YES 7 NO IBCocoaTouchFramework x-source - 1 10 + + 292 - {{20, 306}, {280, 31}} + {{20, 322}, {280, 31}} + NO YES IBCocoaTouchFramework @@ -356,23 +394,69 @@ IBCocoaTouchFramework 1 + + + + + + 292 + {{20, 252}, {54, 21}} + + + + NO + YES + 7 + NO + IBCocoaTouchFramework + x-cancel + + + 1 + 10 + + + + + + 292 + {{20, 271}, {280, 31}} + + + + NO + YES + IBCocoaTouchFramework + 0 + + 3 + cancel callback URL + + 3 + MAA + + + YES + 17 + + IBCocoaTouchFramework + + 1 + + 292 - {{20, 352}, {280, 35}} + {{20, 364}, {280, 35}} + NO IBCocoaTouchFramework 0 0 - - Helvetica-Bold - 15 - 16 - 1 Open URL @@ -384,42 +468,30 @@ 3 MC41AA - - - - 292 - {{20, 11}, {280, 22}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - x-callback-url TEST + + Helvetica-Bold + Helvetica + 2 + 15 + Helvetica-Bold - 18 + 15 16 - - 1 - MCAwIDAAA - - - 1 - 10 - {{0, 20}, {320, 460}} + {{0, 20}, {320, 411}} + 3 MQA + IBCocoaTouchFramework @@ -490,6 +562,14 @@ 44 + + + cancelCallbackField + + + + 59 + delegate @@ -555,13 +635,23 @@ 54 + + + delegate + + + + 58 + YES 0 - + + YES + @@ -570,7 +660,6 @@ YES - @@ -585,7 +674,9 @@ - + + + @@ -676,8 +767,13 @@ - 55 - + 56 + + + + + 57 + @@ -687,114 +783,54 @@ YES -1.CustomClassName + -1.IBPluginDependency -2.CustomClassName + -2.IBPluginDependency 1.CustomClassName - 1.IBEditorWindowLastContentRect 1.IBPluginDependency - 1.IBViewBoundsToFrameTransform 10.IBPluginDependency - 10.IBViewBoundsToFrameTransform 11.IBPluginDependency - 11.IBViewBoundsToFrameTransform 12.IBPluginDependency - 12.IBViewBoundsToFrameTransform 13.IBPluginDependency - 13.IBViewBoundsToFrameTransform 14.IBPluginDependency - 14.IBViewBoundsToFrameTransform 15.IBPluginDependency - 15.IBViewBoundsToFrameTransform 16.IBPluginDependency - 16.IBViewBoundsToFrameTransform 17.IBPluginDependency - 17.IBViewBoundsToFrameTransform 18.IBPluginDependency - 18.IBViewBoundsToFrameTransform 19.IBPluginDependency - 19.IBViewBoundsToFrameTransform 4.IBPluginDependency - 4.IBViewBoundsToFrameTransform 5.IBPluginDependency - 5.IBViewBoundsToFrameTransform 53.IBPluginDependency - 53.IBViewBoundsToFrameTransform - 55.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency 6.IBPluginDependency - 6.IBViewBoundsToFrameTransform 8.IBPluginDependency - 8.IBViewBoundsToFrameTransform - + YES SendViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIScrollView - {{908, 651}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAw+UAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwuwAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwrAAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwwsAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwykAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwz0AAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw1sAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw24AAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw4YAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw48AAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw52AAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwhwAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAwooAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDLAAAw8OAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCxgAAwooAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCxgAAwhwAAA - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -809,7 +845,7 @@ - 55 + 59 @@ -834,13 +870,14 @@ YES actionField callbackField + cancelCallbackField errorCallbackField hostField parametersField schemeField sourceField - + YES UITextField UITextField @@ -849,6 +886,7 @@ UITextField UITextField UITextField + UITextField @@ -857,13 +895,14 @@ YES actionField callbackField + cancelCallbackField errorCallbackField hostField parametersField schemeField sourceField - + YES actionField @@ -873,6 +912,10 @@ callbackField UITextField + + cancelCallbackField + UITextField + errorCallbackField UITextField @@ -906,7 +949,7 @@ IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -914,6 +957,6 @@ YES 3 - 300 + 2083 diff --git a/Classes/XCallbackURLAppDelegate.h b/Classes/XCallbackURLAppDelegate.h index 3085ab7..6e28407 100644 --- a/Classes/XCallbackURLAppDelegate.h +++ b/Classes/XCallbackURLAppDelegate.h @@ -17,7 +17,7 @@ ReceiveViewController *receiveView; } -@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, strong) IBOutlet UIWindow *window; @end diff --git a/Classes/XCallbackURLAppDelegate.m b/Classes/XCallbackURLAppDelegate.m index d5dbbbf..358b32f 100644 --- a/Classes/XCallbackURLAppDelegate.m +++ b/Classes/XCallbackURLAppDelegate.m @@ -50,62 +50,4 @@ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url return [self application:application openURL:url sourceApplication:@"com.unknown.unknown" annotation:nil]; } - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - -- (void)dealloc { - [sendView release]; - [receiveView release]; - [tabBarController release]; - [window release]; - [super dealloc]; -} - - @end diff --git a/XCallbackURL.xcodeproj/project.pbxproj b/XCallbackURL.xcodeproj/project.pbxproj index dc85173..001337c 100755 --- a/XCallbackURL.xcodeproj/project.pbxproj +++ b/XCallbackURL.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -149,8 +149,11 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "XCallbackURL" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -203,6 +206,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -217,6 +221,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = XCallbackURL_Prefix.pch; @@ -234,7 +239,7 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; }; name = Debug; @@ -247,8 +252,8 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; diff --git a/main.m b/main.m index b47d354..a3247f6 100644 --- a/main.m +++ b/main.m @@ -10,8 +10,8 @@ int main(int argc, char *argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - [pool release]; - return retVal; + @autoreleasepool { + int retVal = UIApplicationMain(argc, argv, nil, @"XCallbackURLAppDelegate"); + return retVal; + } }