├── Examples ├── CocoaPodsSampleProjects │ ├── PublicPhotos-Mac │ │ ├── .gitignore │ │ ├── podfile │ │ ├── PublicPhotos │ │ │ ├── en.lproj │ │ │ │ ├── InfoPlist.strings │ │ │ │ └── Credits.rtf │ │ │ ├── PublicPhotos-Prefix.pch │ │ │ ├── Images.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── PublicPhotos-Info.plist │ │ │ ├── OFAPIKey.m │ │ │ ├── main.m │ │ │ ├── OFAPIKey.h │ │ │ ├── OFAppDelegate.h │ │ │ └── OFAppDelegate.m │ │ ├── PublicPhotosTests │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ ├── PublicPhotosTests-Info.plist │ │ │ └── PublicPhotosTests.m │ │ └── Podfile.lock │ ├── PublicPhotos-iOS │ │ ├── .gitignore │ │ ├── podfile │ │ ├── PublicPhotos │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ ├── PublicPhotos-Prefix.pch │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchImage.launchimage │ │ │ │ │ └── Contents.json │ │ │ ├── OFAPIKey.m │ │ │ ├── OFAPIKey.h │ │ │ ├── OFAppDelegate.h │ │ │ ├── OFViewController.h │ │ │ ├── main.m │ │ │ ├── PublicPhotos-Info.plist │ │ │ ├── OFAppDelegate.m │ │ │ ├── Base.lproj │ │ │ │ ├── Main_iPad.storyboard │ │ │ │ └── Main_iPhone.storyboard │ │ │ └── OFViewController.m │ │ ├── PublicPhotosTests │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ ├── PublicPhotosTests-Info.plist │ │ │ └── PublicPhotosTests.m │ │ └── Podfile.lock │ └── README.md ├── OAuthTransitionMac │ └── OAuthTransitionMac │ │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── Credits.rtf │ │ ├── OAuthTransitionMac-Prefix.pch │ │ ├── main.m │ │ ├── AppDelegate.h │ │ └── OAuthTransitionMac-Info.plist ├── SnapAndRun-iPhone │ ├── Images │ │ └── SnapAndRun.png │ ├── SnapAndRun_Prefix.pch │ ├── SnapAndRun-Info.plist │ ├── main.m │ └── Classes │ │ ├── SnapAndRunViewController.h │ │ ├── SnapAndRunAppDelegate.h │ │ └── SnapAndRunAppDelegate.m ├── RandomPublicPhoto │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── RandomPublicPhoto.xcodeproj │ │ └── TemplateIcon.icns │ ├── RandomPublicPhoto_Prefix.pch │ ├── Info.plist │ ├── main.m │ ├── MainWindowController.h │ └── MainWindowController.m └── CommandLineTool │ ├── main.m │ └── CommandLineTool.xcodeproj │ └── project.pbxproj ├── .gitignore ├── LFWebAPIKit ├── Tests │ ├── StreamedBodySendingTest │ │ ├── README.txt │ │ ├── English.lproj │ │ │ └── InfoPlist.strings │ │ ├── StreamedBodySendingTest.xcodeproj │ │ │ └── TemplateIcon.icns │ │ ├── Info.plist │ │ ├── StreamedBodySendingTest_Prefix.pch │ │ ├── main.m │ │ ├── AppDelegate.h │ │ ├── GoogleToolboxForMac-Part │ │ │ ├── Foundation │ │ │ │ ├── GTMGarbageCollection.h │ │ │ │ ├── GTMDebugSelectorValidation.h │ │ │ │ └── GTMHTTPServer.h │ │ │ └── GTMDefines.h │ │ └── AppDelegate.m │ ├── SiteReachability-Mac │ │ ├── English.lproj │ │ │ └── InfoPlist.strings │ │ ├── SiteReachability.xcodeproj │ │ │ └── TemplateIcon.icns │ │ ├── SiteReachability_Prefix.pch │ │ ├── main.m │ │ ├── version.plist │ │ ├── MainController.h │ │ ├── Info.plist │ │ └── MainController.m │ ├── SiteReachability-iPhone │ │ ├── SiteReachability_Prefix.pch │ │ ├── main.m │ │ ├── Classes │ │ │ ├── SiteReachabilityAppDelegate.h │ │ │ ├── SiteReachabilityViewController.h │ │ │ ├── SiteReachabilityAppDelegate.m │ │ │ └── SiteReachabilityViewController.m │ │ ├── SiteReachability-Info.plist │ │ └── MainWindow.xib │ └── SynchronousRequestTest │ │ ├── TestSuite.h │ │ ├── SynchronousRequestTest-Info.plist │ │ ├── TestSuite.m │ │ └── SynchronousRequestTest.xcodeproj │ │ └── project.pbxproj ├── NSData+LFHTTPFormExtensions.h ├── LFWebAPIKit.h ├── NSData+LFHTTPFormExtensions.m ├── LFSiteReachability.h ├── LFHTTPRequest.h └── LFSiteReachability.m ├── ObjectiveFlickr-Info.plist ├── SampleAPIKey.h.template ├── Source ├── OFUtilities.h ├── OFXMLMapper.h ├── OFXMLMapper.m └── ObjectiveFlickr.h └── BridgeSupport └── ObjectiveFlickr.bridgesupport /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/.gitignore: -------------------------------------------------------------------------------- 1 | Pods 2 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/.gitignore: -------------------------------------------------------------------------------- 1 | Pods 2 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/podfile: -------------------------------------------------------------------------------- 1 | pod 'objectiveflickr' 2 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/podfile: -------------------------------------------------------------------------------- 1 | pod 'objectiveflickr' 2 | -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.pbxuser 3 | *.mode1v3 4 | *.tm_build_errors 5 | .DS_Store 6 | SampleAPIKey.h 7 | xcuserdata 8 | *.xcworkspace 9 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotosTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotosTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/Images/SnapAndRun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/Examples/SnapAndRun-iPhone/Images/SnapAndRun.png -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/Examples/RandomPublicPhoto/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/README.txt: -------------------------------------------------------------------------------- 1 | 2 | This test contains parts from Google Toolbox for Mac 3 | (http://code.google.com/p/google-toolbox-for-mac/) 4 | 5 | -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/RandomPublicPhoto.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/Examples/RandomPublicPhoto/RandomPublicPhoto.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/LFWebAPIKit/Tests/SiteReachability-Mac/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/LFWebAPIKit/Tests/StreamedBodySendingTest/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/SiteReachability.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/LFWebAPIKit/Tests/SiteReachability-Mac/SiteReachability.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/RandomPublicPhoto_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'RandomPublicPhoto' target in the 'RandomPublicPhoto' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/StreamedBodySendingTest.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukhnos/objectiveflickr/HEAD/LFWebAPIKit/Tests/StreamedBodySendingTest/StreamedBodySendingTest.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/SiteReachability_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SiteReachability' target in the 'SiteReachability' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/OAuthTransitionMac-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OAuthTransitionMac' target in the 'OAuthTransitionMac' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/SnapAndRun_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SnapAndRun' target in the 'SnapAndRun' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - objectiveflickr (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - objectiveflickr 6 | 7 | SPEC CHECKSUMS: 8 | objectiveflickr: a0fc71147e128f8bca92ac4d13da004873bd7e6b 9 | 10 | COCOAPODS: 0.29.0 11 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - objectiveflickr (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - objectiveflickr 6 | 7 | SPEC CHECKSUMS: 8 | objectiveflickr: a0fc71147e128f8bca92ac4d13da004873bd7e6b 9 | 10 | COCOAPODS: 0.29.0 11 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/SiteReachability_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SiteReachability' target in the 'SiteReachability' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/PublicPhotos-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 7/1/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OAuthTransitionMac 4 | // 5 | // Created by Lukhnos D. Liu on 10/9/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SynchronousRequestTest/TestSuite.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestSuite.h 3 | // SynchronousRequestTest 4 | // 5 | // Created by Lukhnos D. Liu on 6/12/09. 6 | // Copyright 2009 Lithoglyph Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LFWebAPIKit.h" 11 | 12 | @interface TestSuite : SenTestCase 13 | { 14 | LFHTTPRequest *HTTPRequest; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 6/30/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/PublicPhotos-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/README.md: -------------------------------------------------------------------------------- 1 | # ObjectiveFlickr Sample Projects Using CocoaPods 2 | 3 | This directory contains sample projects that show you how to use [CocoaPods](http://cocoapods.org/) to install ObjectiveFlickr as a dependency. 4 | 5 | For example, to build the PublicPhotos-iOS project, enter `PublicPhotos-iOS`, then run: 6 | 7 | pod install 8 | 9 | Then open PublicPhotos.xcworkspace, add your API key and secret to `OFAPIKey.m`. Now you can build and run the sample app. 10 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/version.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildVersion 6 | 3 7 | CFBundleVersion 8 | 1.0 9 | ProductBuildVersion 10 | 9M2729 11 | ProjectName 12 | DevToolsWizardTemplates 13 | SourceVersion 14 | 11600000 15 | 16 | 17 | -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/MainController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainController.h 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 7/1/09. 6 | // Copyright 2009 Lithoglyph Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LFWebAPIKit.h" 11 | 12 | @interface MainController : NSWindowController 13 | { 14 | LFSiteReachability *reachability; 15 | 16 | NSButton *startButton; 17 | NSTextField *statusLabel; 18 | } 19 | - (IBAction)startCheckingAction:(id)sender; 20 | 21 | @property (retain, nonatomic) IBOutlet NSButton *startButton; 22 | @property (retain, nonatomic) IBOutlet NSTextField *statusLabel; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/Classes/SiteReachabilityAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SiteReachabilityAppDelegate.h 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 6/30/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class SiteReachabilityViewController; 12 | 13 | @interface SiteReachabilityAppDelegate : NSObject { 14 | UIWindow *window; 15 | SiteReachabilityViewController *viewController; 16 | } 17 | 18 | @property (nonatomic, retain) IBOutlet UIWindow *window; 19 | @property (nonatomic, retain) IBOutlet SiteReachabilityViewController *viewController; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /ObjectiveFlickr-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.lukhnos.ObjectiveFlickr 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleSignature 16 | OFKR 17 | CFBundleVersion 18 | 2.0.4 19 | 20 | 21 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/Classes/SiteReachabilityViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SiteReachabilityViewController.h 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 6/30/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LFWebAPIKit.h" 11 | 12 | @interface SiteReachabilityViewController : UIViewController 13 | { 14 | LFSiteReachability *reachability; 15 | 16 | UIButton *startButton; 17 | UILabel *statusLabel; 18 | } 19 | - (IBAction)startCheckingAction:(id)sender; 20 | 21 | @property (retain, nonatomic) IBOutlet UIButton *startButton; 22 | @property (retain, nonatomic) IBOutlet UILabel *statusLabel; 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SynchronousRequestTest/SynchronousRequestTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotosTests/PublicPhotosTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.lukhnos.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotosTests/PublicPhotosTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.lukhnos.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/Classes/SiteReachabilityAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SiteReachabilityAppDelegate.m 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 6/30/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import "SiteReachabilityAppDelegate.h" 10 | #import "SiteReachabilityViewController.h" 11 | 12 | @implementation SiteReachabilityAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize viewController; 16 | 17 | 18 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 19 | 20 | // Override point for customization after app launch 21 | [window addSubview:viewController.view]; 22 | [window makeKeyAndVisible]; 23 | } 24 | 25 | 26 | - (void)dealloc { 27 | [viewController release]; 28 | [window release]; 29 | [super dealloc]; 30 | } 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.lukhnos.RandomPublicPhoto 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | LUKH 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.lithoglyph.LFSiteReachabilityTest.Mac 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | LTGF 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.lithoglyph.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | LTGF 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/SiteReachability-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.lithoglyph.LFSiteReachabilityTest.iPhone 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | LTGF 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SynchronousRequestTest/TestSuite.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestSuite.m 3 | // SynchronousRequestTest 4 | // 5 | // Created by Lukhnos D. Liu on 6/12/09. 6 | // Copyright 2009 Lithoglyph Inc.. All rights reserved. 7 | // 8 | 9 | #import "TestSuite.h" 10 | 11 | 12 | @implementation TestSuite 13 | - (void)setUp 14 | { 15 | HTTPRequest = [[LFHTTPRequest alloc] init]; 16 | HTTPRequest.delegate = self; 17 | HTTPRequest.shouldWaitUntilDone = YES; 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | [HTTPRequest release]; 23 | HTTPRequest = nil; 24 | } 25 | 26 | - (void)testFetchData 27 | { 28 | [HTTPRequest performMethod:LFHTTPRequestGETMethod onURL:[NSURL URLWithString:@"http://google.com"] withData:nil]; 29 | NSLog(@"received data: %s", [[HTTPRequest receivedData] bytes]); 30 | } 31 | 32 | - (void)httpRequestDidComplete:(LFHTTPRequest *)request 33 | { 34 | NSLog(@"%s %@", __PRETTY_FUNCTION__, [request receivedData]); 35 | } 36 | 37 | - (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error 38 | { 39 | NSLog(@"%@ %@", __PRETTY_FUNCTION__, error); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OAuthTransitionMac 4 | // 5 | // Created by Lukhnos D. Liu on 10/9/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ObjectiveFlickr/ObjectiveFlickr.h" 11 | 12 | @interface AppDelegate : NSObject 13 | { 14 | OFFlickrAPIContext *_flickrContext; 15 | OFFlickrAPIRequest *_flickrRequest; 16 | 17 | NSString *_frob; 18 | } 19 | @property (assign) IBOutlet NSWindow *window; 20 | 21 | @property (assign) IBOutlet NSButton *oauthAuthButton; 22 | @property (assign) IBOutlet NSButton *oldStyleAuthButton; 23 | @property (assign) IBOutlet NSButton *testLoginButton; 24 | @property (assign) IBOutlet NSButton *upgradeTokenButton; 25 | @property (assign) IBOutlet NSTextField *progressLabel; 26 | @property (assign) IBOutlet NSProgressIndicator *progressIndicator; 27 | 28 | - (IBAction)oldStyleAuthentication:(id)sender; 29 | - (IBAction)oauthAuthenticationAction:(id)sender; 30 | - (IBAction)testLoginAction:(id)sender; 31 | - (IBAction)upgradeTokenAction:(id)sender; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/PublicPhotos-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.lukhnos.ObjectiveFlicrk.${PRODUCT_NAME:rfc1034identifier}-Mac 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Lukhnos Liu. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/SnapAndRun-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | SnapAndRun.png 13 | CFBundleIdentifier 14 | org.lukhnos.SnapAndRun 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | LTGF 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | CFBundleURLTypes 30 | 31 | 32 | CFBundleURLName 33 | org.lukhnos.SnapAndRun 34 | CFBundleURLSchemes 35 | 36 | snapnrun 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/StreamedBodySendingTest_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #ifdef __OBJC__ 27 | #import 28 | #endif 29 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | return NSApplicationMain(argc, (const char **) argv); 33 | } 34 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | return NSApplicationMain(argc, (const char **)argv); 33 | } 34 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/OFAPIKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFAPIKey.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFAPIKey.h" 29 | 30 | NSString *const OFSampleAppAPIKey = @""; 31 | NSString *const OFSampleAppAPISharedSecret = @""; 32 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | int main(int argc, const char * argv[]) 31 | { 32 | return NSApplicationMain(argc, argv); 33 | } 34 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFAPIKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFAPIKey.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFAPIKey.h" 29 | 30 | NSString *const OFSampleAppAPIKey = @""; 31 | NSString *const OFSampleAppAPISharedSecret = @""; 32 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/OFAPIKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFAPIKey.h 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | extern NSString *const OFSampleAppAPIKey; 31 | extern NSString *const OFSampleAppAPISharedSecret; 32 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFAPIKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFAPIKey.h 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | extern NSString *const OFSampleAppAPIKey; 31 | extern NSString *const OFSampleAppAPISharedSecret; 32 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFAppDelegate.h 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | @interface OFAppDelegate : UIResponder 31 | 32 | @property (strong, nonatomic) UIWindow *window; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SampleAPIKey.h.template: -------------------------------------------------------------------------------- 1 | // 2 | // SampleAPIKey.h 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | #error Supply your own Flickr API key and shared secret it, or apply from http://flickr.com/services/api/keys/apply 28 | #define OBJECTIVE_FLICKR_SAMPLE_API_KEY @"" 29 | #define OBJECTIVE_FLICKR_SAMPLE_API_SHARED_SECRET @"" 30 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFViewController.h 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | @interface OFViewController : UIViewController 31 | @property (nonatomic) IBOutlet UIImageView *imageView; 32 | @property (nonatomic) IBOutlet UILabel *imageLabel; 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 33 | int retVal = UIApplicationMain(argc, argv, nil, nil); 34 | [pool release]; 35 | return retVal; 36 | } 37 | -------------------------------------------------------------------------------- /LFWebAPIKit/NSData+LFHTTPFormExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+LFHTTPFormExtensions.h 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import 30 | 31 | @interface NSData (LFHTTPFormExtensions) 32 | + (id)dataAsWWWURLEncodedFormFromDictionary:(NSDictionary *)formDictionary; 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | #import "OFAppDelegate.h" 31 | 32 | int main(int argc, char * argv[]) 33 | { 34 | @autoreleasepool { 35 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([OFAppDelegate class])); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Examples/OAuthTransitionMac/OAuthTransitionMac/OAuthTransitionMac-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.lukhnos.objectiveflickr.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | CFBundleURLTypes 34 | 35 | 36 | CFBundleURLName 37 | OAuthTransitionMac URL 38 | CFBundleURLSchemes 39 | 40 | oatransdemo 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/OFAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFAppDelegate.h 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | @interface OFAppDelegate : NSObject 31 | 32 | @property (assign) IBOutlet NSWindow *window; 33 | @property (assign) IBOutlet NSImageView *imageView; 34 | @property (assign) IBOutlet NSTextField *imageLabel; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /LFWebAPIKit/LFWebAPIKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFWebAPIKit.h 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import "LFHTTPRequest.h" 30 | #import "NSData+LFHTTPFormExtensions.h" 31 | 32 | // LFSiteReachability is only available when built aginst OS X 10.5+ or iPhone SDK 33 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 34 | #import "LFSiteReachability.h" 35 | #endif 36 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | #import "GTMHTTPServer.h" 30 | #import "LFHTTPRequest.h" 31 | 32 | @interface AppDelegate : NSObject 33 | { 34 | IBOutlet NSTextField *messageText; 35 | 36 | GTMHTTPServer *HTTPServer; 37 | LFHTTPRequest *HTTPRequest; 38 | NSMutableData *randomData; 39 | } 40 | - (IBAction)testButtonAction:(id)sender; 41 | @end 42 | -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/MainWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.h 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | #import 30 | #import 31 | 32 | @interface MainWindowController : NSWindowController 33 | { 34 | OFFlickrAPIContext *flickrContext; 35 | OFFlickrAPIRequest *flickrRequest; 36 | IBOutlet NSTextView *textView; 37 | IBOutlet WebView *webView; 38 | } 39 | - (IBAction)nextRandomPhotoAction:(id)sender; 40 | @end 41 | -------------------------------------------------------------------------------- /Source/OFUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFUtilities.h 3 | // 4 | // Copyright (c) 2006-2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | NSString *OFMD5HexStringFromNSString(NSString *inStr); 31 | NSString *OFEscapedURLStringFromNSString(NSString *inStr); 32 | NSString *OFEscapedURLStringFromNSStringWithExtraEscapedChars(NSString *inStr, NSString *inEscChars); 33 | 34 | NSString *OFGenerateUUIDString(void); 35 | 36 | NSString *OFHMACSha1Base64(NSString *inKey, NSString *inMessage); 37 | NSDictionary *OFExtractURLQueryParameter(NSString *inQuery); 38 | BOOL OFExtractOAuthCallback(NSURL *inReceivedURL, NSURL *inBaseURL, NSString **outRequestToken, NSString **outVerifier); 39 | 40 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/PublicPhotos-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.lukhnos.ObjectiveFlickr.${PRODUCT_NAME:rfc1034identifier}-iOS 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-Mac/MainController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainController.m 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 7/1/09. 6 | // Copyright 2009 Lithoglyph Inc.. All rights reserved. 7 | // 8 | 9 | #import "MainController.h" 10 | 11 | 12 | @implementation MainController 13 | - (void)dealloc 14 | { 15 | self.startButton = nil; 16 | self.statusLabel = nil; 17 | [super dealloc]; 18 | } 19 | 20 | - (void)updateNotCheckingStatusLabel 21 | { 22 | [statusLabel setStringValue:[NSString stringWithFormat:@"Not checking, connectivity: %@", ([reachability networkConnectivityExists] ? @"exists" : @"not exists")]]; 23 | } 24 | 25 | - (void)awakeFromNib 26 | { 27 | if (!reachability) { 28 | reachability = [[LFSiteReachability alloc] init]; 29 | reachability.delegate = self; 30 | } 31 | 32 | [startButton setTitle:([reachability isChecking] ? @"Stop Checking" : @"Start Checking")]; 33 | [self updateNotCheckingStatusLabel]; 34 | } 35 | 36 | - (IBAction)startCheckingAction:(id)sender 37 | { 38 | if ([reachability isChecking]) { 39 | [reachability stopChecking]; 40 | [startButton setTitle:@"Start Checking"]; 41 | [self updateNotCheckingStatusLabel]; 42 | } 43 | else { 44 | [statusLabel setStringValue:@"Checking"]; 45 | [reachability startChecking]; 46 | [startButton setTitle:@"Stop Checking"]; 47 | } 48 | } 49 | 50 | - (void)reachability:(LFSiteReachability *)inReachability site:(NSURL *)inURL isAvailableOverConnectionType:(NSString *)inConnectionType 51 | { 52 | [statusLabel setStringValue:[NSString stringWithFormat:@"Reachable, type: %@", ((inConnectionType == LFSiteReachabilityConnectionTypeWiFi) ? @"WiFi" : @"WWAN")]]; 53 | } 54 | 55 | - (void)reachability:(LFSiteReachability *)inReachability siteIsNotAvailable:(NSURL *)inURL 56 | { 57 | [statusLabel setStringValue:@"Not reachable"]; 58 | } 59 | 60 | @synthesize statusLabel; 61 | @synthesize startButton; 62 | @end 63 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotosTests/PublicPhotosTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PublicPhotosTests.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | @interface PublicPhotosTests : XCTestCase 31 | 32 | @end 33 | 34 | @implementation PublicPhotosTests 35 | 36 | - (void)setUp 37 | { 38 | [super setUp]; 39 | // Put setup code here. This method is called before the invocation of each test method in the class. 40 | } 41 | 42 | - (void)tearDown 43 | { 44 | // Put teardown code here. This method is called after the invocation of each test method in the class. 45 | [super tearDown]; 46 | } 47 | 48 | - (void)testExample 49 | { 50 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotosTests/PublicPhotosTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PublicPhotosTests.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | @interface PublicPhotosTests : XCTestCase 31 | 32 | @end 33 | 34 | @implementation PublicPhotosTests 35 | 36 | - (void)setUp 37 | { 38 | [super setUp]; 39 | // Put setup code here. This method is called before the invocation of each test method in the class. 40 | } 41 | 42 | - (void)tearDown 43 | { 44 | // Put teardown code here. This method is called after the invocation of each test method in the class. 45 | [super tearDown]; 46 | } 47 | 48 | - (void)testExample 49 | { 50 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Source/OFXMLMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // OFXMLMapper.h 3 | // 4 | // Copyright (c) 2006-2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | 30 | extern NSString *const OFXMLTextContentKey; 31 | 32 | #if (MAC_OS_X_VERSION_10_6 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_2_0) 33 | @interface OFXMLMapper : NSObject 34 | #else 35 | @interface OFXMLMapper : NSObject 36 | #endif 37 | { 38 | NSMutableDictionary *resultantDictionary; 39 | 40 | NSMutableArray *elementStack; 41 | NSMutableDictionary *currentDictionary; 42 | NSString *currentElementName; 43 | } 44 | + (NSDictionary *)dictionaryMappedFromXMLData:(NSData *)inData; 45 | @end 46 | 47 | @interface NSDictionary (OFXMLMapperExtension) 48 | - (NSString *)textContent; 49 | 50 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 51 | @property (nonatomic, readonly) NSString *textContent; 52 | #endif 53 | @end 54 | -------------------------------------------------------------------------------- /BridgeSupport/ObjectiveFlickr.bridgesupport: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/Classes/SnapAndRunViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SnapAndRunViewController.h 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | #import "ObjectiveFlickr.h" 30 | 31 | @interface SnapAndRunViewController : UIViewController 32 | { 33 | OFFlickrAPIRequest *flickrRequest; 34 | 35 | UIImagePickerController *imagePicker; 36 | 37 | UILabel *authorizeDescriptionLabel; 38 | UILabel *snapPictureDescriptionLabel; 39 | UIButton *authorizeButton; 40 | UIButton *snapPictureButton; 41 | } 42 | - (IBAction)authorizeAction; 43 | - (IBAction)snapPictureAction; 44 | 45 | @property (nonatomic, retain) IBOutlet UILabel *authorizeDescriptionLabel; 46 | @property (nonatomic, retain) IBOutlet UILabel *snapPictureDescriptionLabel; 47 | @property (nonatomic, retain) IBOutlet UIButton *snapPictureButton; 48 | @property (nonatomic, retain) IBOutlet UIButton *authorizeButton; 49 | 50 | @property (nonatomic, retain) OFFlickrAPIRequest *flickrRequest; 51 | @property (nonatomic, retain) UIImagePickerController *imagePicker; 52 | @end 53 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/Classes/SiteReachabilityViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SiteReachabilityViewController.m 3 | // SiteReachability 4 | // 5 | // Created by Lukhnos D. Liu on 6/30/09. 6 | // Copyright Lithoglyph Inc. 2009. All rights reserved. 7 | // 8 | 9 | #import "SiteReachabilityViewController.h" 10 | 11 | @implementation SiteReachabilityViewController 12 | - (void)viewDidLoad 13 | { 14 | [super viewDidLoad]; 15 | 16 | if (!reachability) { 17 | reachability = [[LFSiteReachability alloc] init]; 18 | reachability.delegate = self; 19 | } 20 | } 21 | 22 | 23 | - (void)viewDidUnload 24 | { 25 | self.startButton = nil; 26 | self.statusLabel = nil; 27 | } 28 | 29 | - (void)updateNotCheckingStatusLabel 30 | { 31 | statusLabel.text = [NSString stringWithFormat:@"Not checking, connectivity: %@", ([reachability networkConnectivityExists] ? @"exists" : @"not exists")]; 32 | } 33 | 34 | - (void)viewWillAppear:(BOOL)animated 35 | { 36 | [super viewWillAppear:animated]; 37 | 38 | [startButton setTitle:([reachability isChecking] ? @"Stop Checking" : @"Start Checking") forState:UIControlStateNormal]; 39 | [self updateNotCheckingStatusLabel]; 40 | } 41 | 42 | - (void)dealloc 43 | { 44 | self.startButton = nil; 45 | self.statusLabel = nil; 46 | [super dealloc]; 47 | } 48 | 49 | - (IBAction)startCheckingAction:(id)sender 50 | { 51 | if ([reachability isChecking]) { 52 | [reachability stopChecking]; 53 | [startButton setTitle:@"Start Checking" forState:UIControlStateNormal]; 54 | [self updateNotCheckingStatusLabel]; 55 | } 56 | else { 57 | statusLabel.text = @"Checking"; 58 | [reachability startChecking]; 59 | [startButton setTitle:@"Stop Checking" forState:UIControlStateNormal]; 60 | } 61 | } 62 | 63 | - (void)reachability:(LFSiteReachability *)inReachability site:(NSURL *)inURL isAvailableOverConnectionType:(NSString *)inConnectionType 64 | { 65 | NSLog(@"%s, connection type: ", __PRETTY_FUNCTION__, inConnectionType); 66 | statusLabel.text = [NSString stringWithFormat:@"Reachable, type: %@", ((inConnectionType == LFSiteReachabilityConnectionTypeWiFi) ? @"WiFi" : @"WWAN")]; 67 | } 68 | 69 | - (void)reachability:(LFSiteReachability *)inReachability siteIsNotAvailable:(NSURL *)inURL 70 | { 71 | NSLog(@"%s", __PRETTY_FUNCTION__); 72 | statusLabel.text = @"Not reachable"; 73 | } 74 | 75 | @synthesize statusLabel; 76 | @synthesize startButton; 77 | @end 78 | -------------------------------------------------------------------------------- /LFWebAPIKit/NSData+LFHTTPFormExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+LFHTTPFormExtensions.m 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import "NSData+LFHTTPFormExtensions.h" 30 | 31 | @implementation NSData (LFHTTPFormExtensions) 32 | + (id)dataAsWWWURLEncodedFormFromDictionary:(NSDictionary *)formDictionary 33 | { 34 | NSMutableString *combinedDataString = [NSMutableString string]; 35 | NSEnumerator *enumerator = [formDictionary keyEnumerator]; 36 | 37 | id key = [enumerator nextObject]; 38 | if (key) { 39 | id value = [formDictionary objectForKey:key]; 40 | [combinedDataString appendString:[NSString stringWithFormat:@"%@=%@", [(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; 41 | 42 | while ((key = [enumerator nextObject])) { 43 | value = [formDictionary objectForKey:key]; 44 | [combinedDataString appendString:[NSString stringWithFormat:@"&%@=%@", [(NSString*)key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; 45 | } 46 | } 47 | 48 | return [combinedDataString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]; 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/Classes/SnapAndRunAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SnapAndRunAppDelegate.h 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import 29 | #import "ObjectiveFlickr.h" 30 | 31 | extern NSString *SnapAndRunShouldUpdateAuthInfoNotification; 32 | 33 | @interface SnapAndRunAppDelegate : NSObject 34 | { 35 | UINavigationController *viewController; 36 | UIWindow *window; 37 | 38 | UIActivityIndicatorView *activityIndicator; 39 | UIView *progressView; 40 | UIButton *cancelButton; 41 | UILabel *progressDescription; 42 | 43 | OFFlickrAPIContext *flickrContext; 44 | OFFlickrAPIRequest *flickrRequest; 45 | NSString *flickrUserName; 46 | } 47 | 48 | + (SnapAndRunAppDelegate *)sharedDelegate; 49 | - (void)setAndStoreFlickrAuthToken:(NSString *)inAuthToken secret:(NSString *)inSecret; 50 | 51 | - (IBAction)cancelAction; 52 | 53 | @property (nonatomic, retain) IBOutlet UINavigationController *viewController; 54 | @property (nonatomic, retain) IBOutlet UIWindow *window; 55 | @property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicator; 56 | @property (nonatomic, retain) IBOutlet UIView *progressView; 57 | @property (nonatomic, retain) IBOutlet UIButton *cancelButton; 58 | @property (nonatomic, retain) IBOutlet UILabel *progressDescription; 59 | 60 | @property (nonatomic, readonly) OFFlickrAPIContext *flickrContext; 61 | @property (nonatomic, retain) NSString *flickrUserName; 62 | @end 63 | 64 | extern NSString *SRCallbackURLBaseString; -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/GoogleToolboxForMac-Part/Foundation/GTMGarbageCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMGarbageCollection.h 3 | // 4 | // Copyright 2007-2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | #import 20 | 21 | #import "GTMDefines.h" 22 | 23 | // This allows us to easily move our code from GC to non GC. 24 | // They are no-ops unless we are require Leopard or above. 25 | // See 26 | // http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/index.html 27 | // and 28 | // http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html#//apple_ref/doc/uid/TP40006687-SW1 29 | // for details. 30 | 31 | #if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) && !GTM_IPHONE_SDK 32 | // General use would be to call this through GTMCFAutorelease 33 | // but there may be a reason the you want to make something collectable 34 | // but not autoreleased, especially in pure GC code where you don't 35 | // want to bother with the nop autorelease. Done as a define instead of an 36 | // inline so that tools like Clang's scan-build don't report code as leaking. 37 | #define GTMNSMakeCollectable(cf) ((id)NSMakeCollectable(cf)) 38 | 39 | // GTMNSMakeUncollectable is for global maps, etc. that we don't 40 | // want released ever. You should still retain these in non-gc code. 41 | GTM_INLINE void GTMNSMakeUncollectable(id object) { 42 | [[NSGarbageCollector defaultCollector] disableCollectorForPointer:object]; 43 | } 44 | 45 | // Hopefully no code really needs this, but GTMIsGarbageCollectionEnabled is 46 | // a common way to check at runtime if GC is on. 47 | // There are some places where GC doesn't work w/ things w/in Apple's 48 | // frameworks, so this is here so GTM unittests and detect it, and not run 49 | // individual tests to work around bugs in Apple's frameworks. 50 | GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { 51 | return ([NSGarbageCollector defaultCollector] != nil); 52 | } 53 | 54 | #else 55 | 56 | #define GTMNSMakeCollectable(cf) ((id)(cf)) 57 | 58 | GTM_INLINE void GTMNSMakeUncollectable(id object) { 59 | } 60 | 61 | GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { 62 | return NO; 63 | } 64 | 65 | #endif 66 | 67 | // GTMCFAutorelease makes a CF object collectable in GC mode, or adds it 68 | // to the autorelease pool in non-GC mode. Either way it is taken care 69 | // of. Done as a define instead of an inline so that tools like Clang's 70 | // scan-build don't report code as leaking. 71 | #define GTMCFAutorelease(cf) ([GTMNSMakeCollectable(cf) autorelease]) 72 | 73 | -------------------------------------------------------------------------------- /LFWebAPIKit/LFSiteReachability.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFSiteReachability.h 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import 30 | #import "LFHTTPRequest.h" 31 | 32 | extern NSString *const LFSiteReachabilityConnectionTypeWiFi; 33 | extern NSString *const LFSiteReachabilityConnectionTypeWWAN; 34 | 35 | @class LFSiteReachability; 36 | 37 | @protocol LFSiteReachabilityDelegate 38 | - (void)reachability:(LFSiteReachability *)inReachability site:(NSURL *)inURL isAvailableOverConnectionType:(NSString *)inConnectionType; 39 | - (void)reachability:(LFSiteReachability *)inReachability siteIsNotAvailable:(NSURL *)inURL; 40 | @end 41 | 42 | @interface LFSiteReachability : NSObject 43 | { 44 | id delegate; 45 | NSURL *siteURL; 46 | SCNetworkReachabilityRef reachability; 47 | LFHTTPRequest *siteRequest; 48 | NSTimer *timeoutTimer; 49 | id lastCheckStatus; 50 | } 51 | - (void)startChecking; 52 | - (void)stopChecking; 53 | - (BOOL)isChecking; 54 | 55 | // When networkConnectivityExists returns YES, it simply means network interface is available 56 | // (e.g. WiFi not disabled, has 3G, etc.); that is, the device has the "potential" to connect, 57 | // but that does not mean that an HTTP request will succeed, for various reasons--such as 58 | // the IP is not yet obtained; the interface is not yet fully "up", base station or WiFi hasn't 59 | // assigned a valid IP yet, etc. To read this way: If this method returns NO, it means 60 | // "forget about network, it doesn't exist at all" 61 | - (BOOL)networkConnectivityExists; 62 | 63 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 64 | - (id)delegate; 65 | - (NSURL*)siteURL; 66 | - (NSTimeInterval)timeoutInterval; 67 | #else 68 | @property (assign, nonatomic) id delegate; 69 | @property (retain, nonatomic) NSURL *siteURL; 70 | @property (nonatomic) NSTimeInterval timeoutInterval; 71 | #endif 72 | @end 73 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "AppDelegate.h" 29 | 30 | @implementation AppDelegate 31 | - (void)dealloc 32 | { 33 | [HTTPServer stop]; 34 | [HTTPServer release]; 35 | [HTTPRequest release]; 36 | [randomData release]; 37 | [super dealloc]; 38 | } 39 | 40 | - (void)awakeFromNib 41 | { 42 | HTTPServer = [[GTMHTTPServer alloc] initWithDelegate:self]; 43 | HTTPRequest = [[LFHTTPRequest alloc] init]; 44 | [HTTPRequest setDelegate:self]; 45 | 46 | NSError *error; 47 | [HTTPServer setPort:25642]; 48 | [HTTPServer start:&error]; 49 | 50 | NSAssert(!error, @"Server must start"); 51 | [messageText setStringValue:@"Server started at port 25642, press button to test"]; 52 | } 53 | - (IBAction)testButtonAction:(id)sender 54 | { 55 | if (randomData) { 56 | [randomData release]; 57 | } 58 | 59 | randomData = [[NSMutableData dataWithLength:1024 * 1024] retain]; 60 | uint8_t *bytes = [randomData mutableBytes]; 61 | size_t i; 62 | for (i = 0 ; i < 1024 * 1024 ; i++) { 63 | bytes[i] = 0x80; 64 | } 65 | 66 | NSInputStream *inputStream = [NSInputStream inputStreamWithData:randomData]; 67 | [HTTPRequest performMethod:LFHTTPRequestPOSTMethod onURL:[NSURL URLWithString:@"http://localhost:25642"] withInputStream:inputStream knownContentSize:[randomData length]]; 68 | } 69 | 70 | - (GTMHTTPResponseMessage *)httpServer:(GTMHTTPServer *)server handleRequest:(GTMHTTPRequestMessage *)request 71 | { 72 | NSLog(@"%s %lu", __PRETTY_FUNCTION__, [[request body] length]); 73 | return [GTMHTTPResponseMessage responseWithHTMLString:@"Hello, world!"]; 74 | } 75 | 76 | - (void)httpRequestDidComplete:(LFHTTPRequest *)request 77 | { 78 | NSLog(@"%s %@", __PRETTY_FUNCTION__, [request receivedData]); 79 | } 80 | 81 | - (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error 82 | { 83 | NSLog(@"%s %@", __PRETTY_FUNCTION__, error); 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFAppDelegate.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFAppDelegate.h" 29 | 30 | @implementation OFAppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | // Override point for customization after application launch. 35 | return YES; 36 | } 37 | 38 | - (void)applicationWillResignActive:(UIApplication *)application 39 | { 40 | // 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. 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidEnterBackground:(UIApplication *)application 45 | { 46 | // 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. 47 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 48 | } 49 | 50 | - (void)applicationWillEnterForeground:(UIApplication *)application 51 | { 52 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 53 | } 54 | 55 | - (void)applicationDidBecomeActive:(UIApplication *)application 56 | { 57 | // 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. 58 | } 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application 61 | { 62 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Examples/CommandLineTool/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "ObjectiveFlickr.h" 29 | #import "SampleAPIKey.h" 30 | 31 | BOOL RunLoopShouldContinue = YES; 32 | 33 | @interface SimpleDelegate : NSObject 34 | @end 35 | 36 | @implementation SimpleDelegate 37 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary 38 | { 39 | NSLog(@"%s %@", __PRETTY_FUNCTION__, inResponseDictionary); 40 | 41 | NSArray *photos = [inResponseDictionary valueForKeyPath:@"photos.photo"]; 42 | for (NSDictionary *photo in photos) { 43 | NSLog(@"%@", [inRequest.context photoSourceURLFromDictionary:photo size:OFFlickrMediumSize]); 44 | } 45 | 46 | RunLoopShouldContinue = NO; 47 | } 48 | 49 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didFailWithError:(NSError *)error 50 | { 51 | NSLog(@"%s %@", __PRETTY_FUNCTION__, error); 52 | 53 | RunLoopShouldContinue = NO; 54 | } 55 | @end 56 | 57 | 58 | int main(int argc, char *argv[]) 59 | { 60 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 61 | 62 | if (argc < 2) { 63 | fprintf(stderr, "usage: flickr-list-public-photos \n"); 64 | return 1; 65 | } 66 | 67 | NSString *userID = [NSString stringWithUTF8String:argv[1]]; 68 | 69 | SimpleDelegate *delegate = [[SimpleDelegate alloc] init]; 70 | OFFlickrAPIContext *context = [[OFFlickrAPIContext alloc] initWithAPIKey:OBJECTIVE_FLICKR_SAMPLE_API_KEY sharedSecret:OBJECTIVE_FLICKR_SAMPLE_API_SHARED_SECRET]; 71 | OFFlickrAPIRequest *request = [[OFFlickrAPIRequest alloc] initWithAPIContext:context]; 72 | 73 | [request setDelegate:delegate]; 74 | BOOL callResult = [request callAPIMethodWithGET:@"flickr.people.getPublicPhotos" arguments:[NSDictionary dictionaryWithObjectsAndKeys:userID, @"user_id", @"50", @"per_page", nil]]; 75 | 76 | while (RunLoopShouldContinue) { 77 | [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 78 | } 79 | 80 | [request release]; 81 | [context release]; 82 | [delegate release]; 83 | 84 | [pool drain]; 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Examples/RandomPublicPhoto/MainWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "MainWindowController.h" 29 | #import "SampleAPIKey.h" 30 | 31 | @implementation MainWindowController 32 | - (void)dealloc 33 | { 34 | [flickrContext release]; 35 | [flickrRequest release]; 36 | [super dealloc]; 37 | } 38 | 39 | - (void)awakeFromNib 40 | { 41 | flickrContext = [[OFFlickrAPIContext alloc] initWithAPIKey:OBJECTIVE_FLICKR_SAMPLE_API_KEY sharedSecret:OBJECTIVE_FLICKR_SAMPLE_API_SHARED_SECRET]; 42 | flickrRequest = [[OFFlickrAPIRequest alloc] initWithAPIContext:flickrContext]; 43 | [flickrRequest setDelegate:self]; 44 | [self nextRandomPhotoAction:self]; 45 | 46 | [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(nextRandomPhotoAction:) userInfo:nil repeats:YES] fire]; 47 | 48 | [webView setDrawsBackground:NO]; 49 | 50 | [[self window] center]; 51 | } 52 | 53 | - (IBAction)nextRandomPhotoAction:(id)sender 54 | { 55 | if (![flickrRequest isRunning]) { 56 | [flickrRequest callAPIMethodWithGET:@"flickr.photos.getRecent" arguments:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"per_page", nil]]; 57 | } 58 | } 59 | 60 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary 61 | { 62 | NSDictionary *photoDict = [[inResponseDictionary valueForKeyPath:@"photos.photo"] objectAtIndex:0]; 63 | 64 | NSString *title = [photoDict objectForKey:@"title"]; 65 | if (![title length]) { 66 | title = @"No title"; 67 | } 68 | 69 | NSURL *photoSourcePage = [flickrContext photoWebPageURLFromDictionary:photoDict]; 70 | NSDictionary *linkAttr = [NSDictionary dictionaryWithObjectsAndKeys:photoSourcePage, NSLinkAttributeName, nil]; 71 | NSMutableAttributedString *attrString = [[[NSMutableAttributedString alloc] initWithString:title attributes:linkAttr] autorelease]; 72 | [[textView textStorage] setAttributedString:attrString]; 73 | 74 | NSURL *photoURL = [flickrContext photoSourceURLFromDictionary:photoDict size:OFFlickrSmallSize]; 75 | NSString *htmlSource = [NSString stringWithFormat: 76 | @"" 77 | @"" 78 | @" " 79 | @"" 80 | @"" 81 | @" " 82 | @" " 83 | @"
" 84 | @"" 85 | @"" 86 | , photoURL]; 87 | 88 | [[webView mainFrame] loadHTMLString:htmlSource baseURL:nil]; 89 | } 90 | 91 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didFailWithError:(NSError *)inError 92 | { 93 | } 94 | @end 95 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/GoogleToolboxForMac-Part/Foundation/GTMDebugSelectorValidation.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMDebugSelectorValidation.h 3 | // 4 | // This file should only be included within an implimation file. In any 5 | // function that takes an object and selector to invoke, you should call: 6 | // 7 | // GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, @encode(arg1type), ..., NULL) 8 | // or 9 | // GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(obj, sel, @encode(returnType), @encode(arg1type), ..., NULL) 10 | // 11 | // This will then validate that the selector is defined and using the right 12 | // type(s), this can help catch errors much earlier then waiting for the 13 | // selector to actually fire (and in the case of error selectors, might never 14 | // really be tested until in the field). 15 | // 16 | // Copyright 2007-2008 Google Inc. 17 | // 18 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 19 | // use this file except in compliance with the License. You may obtain a copy 20 | // of the License at 21 | // 22 | // http://www.apache.org/licenses/LICENSE-2.0 23 | // 24 | // Unless required by applicable law or agreed to in writing, software 25 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 26 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 27 | // License for the specific language governing permissions and limitations under 28 | // the License. 29 | // 30 | 31 | #if DEBUG 32 | 33 | #import 34 | #import "GTMDefines.h" 35 | 36 | static void GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(id obj, SEL sel, const char *retType, ...) { 37 | 38 | // verify that the object's selector is implemented with the proper 39 | // number and type of arguments 40 | va_list argList; 41 | va_start(argList, retType); 42 | 43 | if (obj && sel) { 44 | // check that the selector is implemented 45 | _GTMDevAssert([obj respondsToSelector:sel], 46 | @"\"%@\" selector \"%@\" is unimplemented or misnamed", 47 | NSStringFromClass([obj class]), 48 | NSStringFromSelector(sel)); 49 | 50 | const char *expectedArgType; 51 | NSUInteger argCount = 2; // skip self and _cmd 52 | NSMethodSignature *sig = [obj methodSignatureForSelector:sel]; 53 | 54 | // check that each expected argument is present and of the correct type 55 | while ((expectedArgType = va_arg(argList, const char*)) != 0) { 56 | 57 | if ([sig numberOfArguments] > argCount) { 58 | const char *foundArgType = [sig getArgumentTypeAtIndex:argCount]; 59 | 60 | _GTMDevAssert(0 == strncmp(foundArgType, expectedArgType, strlen(expectedArgType)), 61 | @"\"%@\" selector \"%@\" argument %d should be type %s", 62 | NSStringFromClass([obj class]), 63 | NSStringFromSelector(sel), 64 | (argCount - 2), 65 | expectedArgType); 66 | } 67 | argCount++; 68 | } 69 | 70 | // check that the proper number of arguments are present in the selector 71 | _GTMDevAssert(argCount == [sig numberOfArguments], 72 | @"\"%@\" selector \"%@\" should have %d arguments", 73 | NSStringFromClass([obj class]), 74 | NSStringFromSelector(sel), 75 | (argCount - 2)); 76 | 77 | // if asked, validate the return type 78 | if (retType && (strcmp("gtm_skip_return_test", retType) != 0)) { 79 | const char *foundRetType = [sig methodReturnType]; 80 | _GTMDevAssert(0 == strncmp(foundRetType, retType, strlen(retType)), 81 | @"\"%@\" selector \"%@\" return type should be type %s", 82 | NSStringFromClass([obj class]), 83 | NSStringFromSelector(sel), 84 | retType); 85 | } 86 | } 87 | 88 | va_end(argList); 89 | } 90 | 91 | #define GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, ...) \ 92 | GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments((obj), (sel), "gtm_skip_return_test", __VA_ARGS__) 93 | 94 | #else // DEBUG 95 | 96 | // make it go away if not debug 97 | #define GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(obj, sel, retType, ...) do { } while (0) 98 | #define GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, ...) do { } while (0) 99 | 100 | #endif // DEBUG 101 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/GoogleToolboxForMac-Part/Foundation/GTMHTTPServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMHTTPServer.h 3 | // 4 | // This is a *very* *simple* webserver that can be built into something, it is 5 | // not meant to stand up a site, it sends all requests to its delegate for 6 | // processing on the main thread. It does not support pipelining, etc. It's 7 | // great for places where you need a simple webserver to unittest some code 8 | // that hits a server. 9 | // 10 | // NOTE: there are several TODOs left in here as markers for things that could 11 | // be done if one wanted to add more to this class. 12 | // 13 | // Copyright 2008 Google Inc. 14 | // 15 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 16 | // use this file except in compliance with the License. You may obtain a copy 17 | // of the License at 18 | // 19 | // http://www.apache.org/licenses/LICENSE-2.0 20 | // 21 | // Unless required by applicable law or agreed to in writing, software 22 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 23 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 24 | // License for the specific language governing permissions and limitations under 25 | // the License. 26 | // 27 | // Based a little on HTTPServer, part of the CocoaHTTPServer sample code 28 | // http://developer.apple.com/samplecode/CocoaHTTPServer/index.html 29 | // 30 | 31 | #import 32 | #import "GTMDefines.h" 33 | 34 | #if GTM_IPHONE_SDK 35 | #import 36 | #endif // GTM_IPHONE_SDK 37 | 38 | // Global contants needed for errors from start 39 | 40 | #undef _EXTERN 41 | #undef _INITIALIZE_AS 42 | #ifdef GTMHTTPSERVER_DEFINE_GLOBALS 43 | #define _EXTERN 44 | #define _INITIALIZE_AS(x) =x 45 | #else 46 | #define _EXTERN GTM_EXTERN 47 | #define _INITIALIZE_AS(x) 48 | #endif 49 | 50 | _EXTERN NSString* kGTMHTTPServerErrorDomain _INITIALIZE_AS(@"com.google.mactoolbox.HTTPServerDomain"); 51 | enum { 52 | kGTMHTTPServerSocketCreateFailedError = -100, 53 | kGTMHTTPServerBindFailedError = -101, 54 | kGTMHTTPServerListenFailedError = -102, 55 | kGTMHTTPServerHandleCreateFailedError = -103, 56 | }; 57 | 58 | @class GTMHTTPRequestMessage, GTMHTTPResponseMessage; 59 | 60 | // ---------------------------------------------------------------------------- 61 | 62 | // See comment at top of file for the intened use of this class. 63 | @interface GTMHTTPServer : NSObject { 64 | @private 65 | __weak id delegate_; 66 | uint16_t port_; 67 | BOOL localhostOnly_; 68 | NSFileHandle *listenHandle_; 69 | NSMutableArray *connections_; 70 | } 71 | 72 | // The delegate must support the httpServer:handleRequest: method in 73 | // NSObject(GTMHTTPServerDeletateMethods) below. 74 | - (id)initWithDelegate:(id)delegate; 75 | 76 | - (id)delegate; 77 | 78 | // Passing port zero will let one get assigned. 79 | - (uint16_t)port; 80 | - (void)setPort:(uint16_t)port; 81 | 82 | // Receive connections on the localHost loopback address only or on all 83 | // interfaces for this machine. The default is to only listen on localhost. 84 | - (BOOL)localhostOnly; 85 | - (void)setLocalhostOnly:(BOOL)yesno; 86 | 87 | // Start/Stop the web server. If there is an error starting up the server, |NO| 88 | // is returned, and the specific startup failure can be returned in |error| (see 89 | // above for the error domain and error codes). If the server is started, |YES| 90 | // is returned and the server's delegate is called for any requests that come 91 | // in. 92 | - (BOOL)start:(NSError **)error; 93 | - (void)stop; 94 | 95 | // returns the number of requests currently active in the server (i.e.-being 96 | // read in, sent replies). 97 | - (NSUInteger)activeRequestCount; 98 | 99 | @end 100 | 101 | @interface NSObject (GTMHTTPServerDeletateMethods) 102 | - (GTMHTTPResponseMessage *)httpServer:(GTMHTTPServer *)server 103 | handleRequest:(GTMHTTPRequestMessage *)request; 104 | @end 105 | 106 | // ---------------------------------------------------------------------------- 107 | 108 | // Encapsulates an http request, one of these is sent to the server's delegate 109 | // for each request. 110 | @interface GTMHTTPRequestMessage : NSObject { 111 | @private 112 | CFHTTPMessageRef message_; 113 | } 114 | - (NSString *)version; 115 | - (NSURL *)URL; 116 | - (NSString *)method; 117 | - (NSData *)body; 118 | - (NSDictionary *)allHeaderFieldValues; 119 | @end 120 | 121 | // ---------------------------------------------------------------------------- 122 | 123 | // Encapsulates an http response, the server's delegate should return one for 124 | // each request received. 125 | @interface GTMHTTPResponseMessage : NSObject { 126 | @private 127 | CFHTTPMessageRef message_; 128 | } 129 | + (id)responseWithHTMLString:(NSString *)htmlString; 130 | + (id)responseWithBody:(NSData *)body 131 | contentType:(NSString *)contentType 132 | statusCode:(int)statusCode; 133 | + (id)emptyResponseWithCode:(int)statusCode; 134 | // TODO: class method for redirections? 135 | // TODO: add helper for expire/no-cache 136 | - (void)setValue:(NSString*)value forHeaderField:(NSString*)headerField; 137 | @end 138 | -------------------------------------------------------------------------------- /Source/OFXMLMapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFXMLMapper.m 3 | // 4 | // Copyright (c) 2006-2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFXMLMapper.h" 29 | 30 | NSString *const OFXMLMapperExceptionName = @"OFXMLMapperException"; 31 | NSString *const OFXMLTextContentKey = @"_text"; 32 | 33 | @implementation OFXMLMapper 34 | - (void)dealloc 35 | { 36 | [resultantDictionary release]; 37 | [elementStack release]; 38 | [currentElementName release]; 39 | [super dealloc]; 40 | } 41 | 42 | - (id)init 43 | { 44 | if ((self = [super init])) { 45 | resultantDictionary = [[NSMutableDictionary alloc] init]; 46 | elementStack = [[NSMutableArray alloc] init]; 47 | } 48 | 49 | return self; 50 | } 51 | 52 | - (void)runWithData:(NSData *)inData 53 | { 54 | currentDictionary = resultantDictionary; 55 | 56 | NSXMLParser *parser = [[NSXMLParser alloc] initWithData:inData]; 57 | [parser setDelegate:self]; 58 | [parser parse]; 59 | [parser release]; 60 | } 61 | 62 | - (NSDictionary *)resultantDictionary 63 | { 64 | return [[resultantDictionary retain] autorelease]; 65 | } 66 | 67 | + (NSDictionary *)dictionaryMappedFromXMLData:(NSData *)inData 68 | { 69 | OFXMLMapper *mapper = [[OFXMLMapper alloc] init]; 70 | [mapper runWithData:inData]; 71 | NSDictionary *result = [mapper resultantDictionary]; 72 | [mapper release]; 73 | return result; 74 | } 75 | 76 | - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict 77 | { 78 | NSMutableDictionary *mutableAttrDict = attributeDict ? [NSMutableDictionary dictionaryWithDictionary:attributeDict] : [NSMutableDictionary dictionary]; 79 | 80 | // see if it's duplicated 81 | id element = [currentDictionary objectForKey:elementName]; 82 | if (element) { 83 | if (![element isKindOfClass:[NSMutableArray class]]) { 84 | if ([element isKindOfClass:[NSMutableDictionary class]]) { 85 | [element retain]; 86 | [currentDictionary removeObjectForKey:elementName]; 87 | 88 | NSMutableArray *newArray = [NSMutableArray arrayWithObject:element]; 89 | [currentDictionary setObject:newArray forKey:elementName]; 90 | [element release]; 91 | 92 | element = newArray; 93 | } 94 | else { 95 | @throw [NSException exceptionWithName:OFXMLMapperExceptionName reason:@"Faulty XML structure" userInfo:nil]; 96 | } 97 | } 98 | 99 | [element addObject:mutableAttrDict]; 100 | } 101 | else { 102 | // plural tag rule: if the parent's tag is plural and the incoming is singular, we'll make it into an array (we only handles the -s case) 103 | 104 | if ([currentElementName length] > [elementName length] && [currentElementName hasPrefix:elementName] && [currentElementName hasSuffix:@"s"]) { 105 | [currentDictionary setObject:[NSMutableArray arrayWithObject:mutableAttrDict] forKey:elementName]; 106 | } 107 | else { 108 | [currentDictionary setObject:mutableAttrDict forKey:elementName]; 109 | } 110 | } 111 | 112 | [elementStack insertObject:currentDictionary atIndex:0]; 113 | currentDictionary = mutableAttrDict; 114 | 115 | NSString *tmp = currentElementName; 116 | currentElementName = [elementName retain]; 117 | [tmp release]; 118 | } 119 | 120 | - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 121 | { 122 | if (![elementStack count]) { 123 | @throw [NSException exceptionWithName:OFXMLMapperExceptionName reason:@"Unbalanced XML element tag closing" userInfo:nil]; 124 | } 125 | 126 | currentDictionary = [elementStack objectAtIndex:0]; 127 | [elementStack removeObjectAtIndex:0]; 128 | } 129 | 130 | - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string 131 | { 132 | NSString *existingContent = [currentDictionary objectForKey:OFXMLTextContentKey]; 133 | if (existingContent) { 134 | NSString *newContent = [existingContent stringByAppendingString:string]; 135 | [currentDictionary setObject:newContent forKey:OFXMLTextContentKey]; 136 | } 137 | else { 138 | [currentDictionary setObject:string forKey:OFXMLTextContentKey]; 139 | } 140 | } 141 | 142 | - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError 143 | { 144 | [resultantDictionary release]; 145 | resultantDictionary = nil; 146 | } 147 | @end 148 | 149 | @implementation NSDictionary (OFXMLMapperExtension) 150 | - (NSString *)textContent 151 | { 152 | return [self objectForKey:OFXMLTextContentKey]; 153 | } 154 | @end 155 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-iOS/PublicPhotos/OFViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFViewController.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFViewController.h" 29 | #import 30 | #import "OFAPIKey.h" 31 | 32 | @interface OFViewController () 33 | @property (nonatomic) OFFlickrAPIContext *flickrContext; 34 | @property (nonatomic) OFFlickrAPIRequest *flickrRequest; 35 | @property (nonatomic) NSString *nextPhotoTitle; 36 | @property (nonatomic) NSURLSession *urlSession; 37 | @property (nonatomic) NSURLSessionDownloadTask *imageDownloadTask; 38 | @property (weak, nonatomic) NSTimer *fetchTimer; 39 | @end 40 | 41 | @implementation OFViewController 42 | 43 | - (void)viewDidLoad 44 | { 45 | [super viewDidLoad]; 46 | 47 | self.flickrContext = [[OFFlickrAPIContext alloc] initWithAPIKey:OFSampleAppAPIKey sharedSecret:OFSampleAppAPISharedSecret]; 48 | self.urlSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue mainQueue]]; 49 | self.imageView.backgroundColor = [UIColor grayColor]; 50 | } 51 | 52 | - (void)viewDidAppear:(BOOL)animated 53 | { 54 | [super viewDidAppear:animated]; 55 | 56 | self.fetchTimer = [NSTimer scheduledTimerWithTimeInterval:7.0 target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES]; 57 | [self makeNextPhotoRequest]; 58 | } 59 | 60 | - (void)viewWillDisappear:(BOOL)animated 61 | { 62 | [super viewWillDisappear:animated]; 63 | 64 | [self.fetchTimer invalidate]; 65 | 66 | [self.flickrRequest cancel]; 67 | self.flickrRequest = nil; 68 | 69 | [self.imageDownloadTask cancel]; 70 | self.imageDownloadTask = nil; 71 | } 72 | 73 | - (void)makeNextPhotoRequest 74 | { 75 | self.imageLabel.text = NSLocalizedString(@"Getting next photo…", nil); 76 | 77 | self.flickrRequest = [[OFFlickrAPIRequest alloc] initWithAPIContext:self.flickrContext]; 78 | self.flickrRequest.delegate = self; 79 | [self.flickrRequest callAPIMethodWithGET:@"flickr.photos.getRecent" arguments:@{@"per_page": @"1"}]; 80 | } 81 | 82 | - (void)handleTimer:(NSTimer *)timer 83 | { 84 | // NSURLSessionTaskStateRunning is 0, so a non-nil test for imageDownloadTask is needed 85 | if ([self.flickrRequest isRunning] || (self.imageDownloadTask && self.imageDownloadTask.state == NSURLSessionTaskStateRunning)) { 86 | return; 87 | } 88 | 89 | [self makeNextPhotoRequest]; 90 | } 91 | 92 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)request didCompleteWithResponse:(NSDictionary *)response 93 | { 94 | NSDictionary *photoDict = [[response valueForKeyPath:@"photos.photo"] objectAtIndex:0]; 95 | NSString *title = [photoDict objectForKey:@"title"]; 96 | if (![title length]) { 97 | title = NSLocalizedString(@"No Title", nil); 98 | } 99 | self.nextPhotoTitle = title; 100 | 101 | self.flickrRequest = nil; 102 | 103 | NSURL *photoURL = [self.flickrContext photoSourceURLFromDictionary:photoDict size:OFFlickrLargeSize]; 104 | self.imageDownloadTask = [self.urlSession downloadTaskWithURL:photoURL]; 105 | [self.imageDownloadTask resume]; 106 | } 107 | 108 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)request didFailWithError:(NSError *)error 109 | { 110 | self.imageView.backgroundColor = [UIColor grayColor]; 111 | self.imageView.image = nil; 112 | self.imageLabel.text = NSLocalizedString(@"Error loading image", nil); 113 | self.flickrRequest = nil; 114 | } 115 | 116 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location 117 | { 118 | // If image is large, consider creating the image off the main queue 119 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:location]]; 120 | self.imageView.image = image; 121 | self.imageLabel.text = self.nextPhotoTitle; 122 | 123 | 124 | NSError *error; 125 | BOOL result = [[NSFileManager defaultManager] removeItemAtURL:location error:&error]; 126 | if (!result) { 127 | NSLog(@"Error removing temp file at: %@, error: %@", location, error); 128 | } 129 | } 130 | 131 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite 132 | { 133 | self.imageLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Getting image (%llu of %llu KB)", nil), totalBytesWritten / 1024, totalBytesExpectedToWrite / 1024]; 134 | } 135 | 136 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes 137 | { 138 | } 139 | 140 | - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error 141 | { 142 | if (error) { 143 | self.imageView.backgroundColor = [UIColor grayColor]; 144 | self.imageView.image = nil; 145 | } 146 | 147 | self.imageDownloadTask = nil; 148 | } 149 | @end 150 | -------------------------------------------------------------------------------- /Examples/CocoaPodsSampleProjects/PublicPhotos-Mac/PublicPhotos/OFAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OFAppDelegate.m 3 | // 4 | // Copyright (c) 2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "OFAppDelegate.h" 29 | #import 30 | #import "OFAPIKey.h" 31 | 32 | @interface OFAppDelegate () 33 | @property (nonatomic) OFFlickrAPIContext *flickrContext; 34 | @property (nonatomic) OFFlickrAPIRequest *flickrRequest; 35 | @property (nonatomic) NSString *nextPhotoTitle; 36 | @property (nonatomic) NSURL *nextPhotoSourcePage; 37 | @property (nonatomic) NSURLSession *urlSession; 38 | @property (nonatomic) NSURLSessionDownloadTask *imageDownloadTask; 39 | @property (weak, nonatomic) NSTimer *fetchTimer; 40 | @end 41 | 42 | @implementation OFAppDelegate 43 | 44 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 45 | { 46 | self.flickrContext = [[OFFlickrAPIContext alloc] initWithAPIKey:OFSampleAppAPIKey sharedSecret:OFSampleAppAPISharedSecret]; 47 | self.urlSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue mainQueue]]; 48 | self.fetchTimer = [NSTimer scheduledTimerWithTimeInterval:7.0 target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES]; 49 | [self makeNextPhotoRequest]; 50 | } 51 | 52 | - (void)makeNextPhotoRequest 53 | { 54 | [self.imageLabel setStringValue:NSLocalizedString(@"Getting next photo…", nil)]; 55 | 56 | self.flickrRequest = [[OFFlickrAPIRequest alloc] initWithAPIContext:self.flickrContext]; 57 | self.flickrRequest.delegate = self; 58 | [self.flickrRequest callAPIMethodWithGET:@"flickr.photos.getRecent" arguments:@{@"per_page": @"1"}]; 59 | } 60 | 61 | - (void)handleTimer:(NSTimer *)timer 62 | { 63 | // NSURLSessionTaskStateRunning is 0, so a non-nil test for imageDownloadTask is needed 64 | if ([self.flickrRequest isRunning] || (self.imageDownloadTask && self.imageDownloadTask.state == NSURLSessionTaskStateRunning)) { 65 | return; 66 | } 67 | 68 | [self makeNextPhotoRequest]; 69 | } 70 | 71 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)request didCompleteWithResponse:(NSDictionary *)response 72 | { 73 | NSDictionary *photoDict = [[response valueForKeyPath:@"photos.photo"] objectAtIndex:0]; 74 | NSString *title = [photoDict objectForKey:@"title"]; 75 | if (![title length]) { 76 | title = NSLocalizedString(@"No Title", nil); 77 | } 78 | self.nextPhotoTitle = title; 79 | 80 | NSURL *photoSourcePage = [self.flickrContext photoWebPageURLFromDictionary:photoDict]; 81 | self.nextPhotoSourcePage = photoSourcePage; 82 | 83 | self.flickrRequest = nil; 84 | 85 | NSURL *photoURL = [self.flickrContext photoSourceURLFromDictionary:photoDict size:OFFlickrLargeSize]; 86 | self.imageDownloadTask = [self.urlSession downloadTaskWithURL:photoURL]; 87 | [self.imageDownloadTask resume]; 88 | } 89 | 90 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)request didFailWithError:(NSError *)error 91 | { 92 | [self.imageView setImage:nil]; 93 | [self.imageLabel setStringValue:NSLocalizedString(@"Error loading image", nil)]; 94 | self.flickrRequest = nil; 95 | } 96 | 97 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location 98 | { 99 | // If image is large, consider creating the image off the main queue 100 | NSImage *image = [[NSImage alloc] initWithData:[NSData dataWithContentsOfURL:location]]; 101 | [self.imageView setImage:image]; 102 | 103 | NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; 104 | [paragraphStyle setAlignment:NSCenterTextAlignment]; 105 | NSDictionary *attrs = @{NSParagraphStyleAttributeName: paragraphStyle, 106 | NSLinkAttributeName: self.nextPhotoSourcePage, 107 | NSForegroundColorAttributeName: [NSColor blueColor], 108 | NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle)}; 109 | NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:self.nextPhotoTitle attributes:attrs]; 110 | 111 | // https://developer.apple.com/library/mac/qa/qa1487/_index.html 112 | [self.imageLabel setAllowsEditingTextAttributes:YES]; 113 | [self.imageLabel setSelectable:YES]; 114 | [self.imageLabel setAttributedStringValue:attrString]; 115 | 116 | NSError *error; 117 | BOOL result = [[NSFileManager defaultManager] removeItemAtURL:location error:&error]; 118 | if (!result) { 119 | NSLog(@"Error removing temp file at: %@, error: %@", location, error); 120 | } 121 | } 122 | 123 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite 124 | { 125 | [self.imageLabel setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Getting image (%llu of %llu KB)", nil), totalBytesWritten / 1024, totalBytesExpectedToWrite / 1024]]; 126 | } 127 | 128 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes 129 | { 130 | } 131 | 132 | - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error 133 | { 134 | if (error) { 135 | [self.imageView setImage:nil]; 136 | } 137 | 138 | self.imageDownloadTask = nil; 139 | } 140 | @end 141 | -------------------------------------------------------------------------------- /LFWebAPIKit/LFHTTPRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFHTTPRequest.h 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import 30 | #if TARGET_OS_IPHONE 31 | #import 32 | #import 33 | #import 34 | #endif 35 | 36 | extern NSString *const LFHTTPRequestConnectionError; 37 | extern NSString *const LFHTTPRequestTimeoutError; 38 | extern const NSTimeInterval LFHTTPRequestDefaultTimeoutInterval; 39 | extern NSString *const LFHTTPRequestWWWFormURLEncodedContentType; 40 | extern NSString *const LFHTTPRequestGETMethod; 41 | extern NSString *const LFHTTPRequestHEADMethod; 42 | extern NSString *const LFHTTPRequestPOSTMethod; 43 | 44 | @interface LFHTTPRequest : NSObject 45 | { 46 | id _delegate; 47 | 48 | NSTimeInterval _timeoutInterval; 49 | NSString *_userAgent; 50 | NSString *_contentType; 51 | 52 | NSDictionary *_requestHeader; 53 | 54 | NSMutableData *_receivedData; 55 | NSString *_receivedContentType; 56 | 57 | CFReadStreamRef _readStream; 58 | NSTimer *_receivedDataTracker; 59 | NSTimeInterval _lastReceivedDataUpdateTime; 60 | 61 | NSTimer *_requestMessageBodyTracker; 62 | NSTimeInterval _lastSentDataUpdateTime; 63 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 64 | NSUInteger _requestMessageBodySize; 65 | NSUInteger _expectedDataLength; 66 | NSUInteger _lastReceivedBytes; 67 | NSUInteger _lastSentBytes; 68 | #else 69 | unsigned int _requestMessageBodySize; 70 | unsigned int _expectedDataLength; 71 | unsigned int _lastReceivedBytes; 72 | unsigned int _lastSentBytes; 73 | #endif 74 | 75 | void *_readBuffer; 76 | size_t _readBufferSize; 77 | 78 | id _sessionInfo; 79 | 80 | BOOL _shouldWaitUntilDone; 81 | NSMessagePort *_synchronousMessagePort; 82 | } 83 | 84 | - (id)init; 85 | - (BOOL)isRunning; 86 | - (void)cancel; 87 | - (void)cancelWithoutDelegateMessage; 88 | 89 | - (BOOL)shouldWaitUntilDone; 90 | - (void)setShouldWaitUntilDone:(BOOL)waitUntilDone; 91 | 92 | - (BOOL)performMethod:(NSString *)methodName onURL:(NSURL *)url withData:(NSData *)data; 93 | 94 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 95 | - (BOOL)performMethod:(NSString *)methodName onURL:(NSURL *)url withInputStream:(NSInputStream *)inputStream knownContentSize:(NSUInteger)byteStreamSize; 96 | #else 97 | - (BOOL)performMethod:(NSString *)methodName onURL:(NSURL *)url withInputStream:(NSInputStream *)inputStream knownContentSize:(unsigned int)byteStreamSize; 98 | #endif 99 | 100 | - (NSData *)getReceivedDataAndDetachFromRequest; 101 | 102 | - (NSTimeInterval)timeoutInterval; 103 | - (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval; 104 | - (NSData *)receivedData; 105 | - (NSString *)receivedContentType; 106 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 107 | - (NSUInteger)expectedDataLength; 108 | #else 109 | - (unsigned int)expectedDataLength; 110 | #endif 111 | 112 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 113 | 114 | @property (copy) NSDictionary *requestHeader; 115 | @property (assign) NSTimeInterval timeoutInterval; 116 | @property (copy) NSString *userAgent; 117 | @property (copy) NSString *contentType; 118 | @property (readonly) NSData *receivedData; 119 | @property (readonly) NSUInteger expectedDataLength; 120 | @property (assign) id delegate; 121 | @property (retain) id sessionInfo; 122 | @property (assign) BOOL shouldWaitUntilDone; 123 | @property (readonly) BOOL isRunning; 124 | 125 | #else 126 | 127 | - (NSDictionary *)requestHeader; 128 | - (void)setRequestHeader:(NSDictionary *)requestHeader; 129 | - (NSString *)userAgent; 130 | - (void)setUserAgent:(NSString *)userAgent; 131 | - (NSString *)contentType; 132 | - (void)setContentType:(NSString *)contentType; 133 | - (id)delegate; 134 | - (void)setDelegate:(id)delegate; 135 | - (void)setSessionInfo:(id)aSessionInfo; 136 | - (id)sessionInfo; 137 | 138 | 139 | #endif 140 | 141 | @end 142 | 143 | @interface NSObject (LFHTTPRequestDelegate) 144 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4 145 | - (void)httpRequest:(LFHTTPRequest *)request didReceiveStatusCode:(NSUInteger)statusCode URL:(NSURL *)url responseHeader:(CFHTTPMessageRef)header; 146 | - (void)httpRequestDidComplete:(LFHTTPRequest *)request; 147 | - (void)httpRequestDidCancel:(LFHTTPRequest *)request; 148 | - (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error; 149 | - (void)httpRequest:(LFHTTPRequest *)request receivedBytes:(NSUInteger)bytesReceived expectedTotal:(NSUInteger)total; 150 | - (void)httpRequest:(LFHTTPRequest *)request sentBytes:(NSUInteger)bytesSent total:(NSUInteger)total; 151 | 152 | // note if you implemented this, the data is never written to the receivedData of the HTTP request instance 153 | - (void)httpRequest:(LFHTTPRequest *)request writeReceivedBytes:(void *)bytes size:(NSUInteger)blockSize expectedTotal:(NSUInteger)total; 154 | #else 155 | - (void)httpRequest:(LFHTTPRequest *)request didReceiveStatusCode:(unsigned int)statusCode URL:(NSURL *)url responseHeader:(CFHTTPMessageRef)header; 156 | - (void)httpRequestDidComplete:(LFHTTPRequest *)request; 157 | - (void)httpRequestDidCancel:(LFHTTPRequest *)request; 158 | - (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error; 159 | - (void)httpRequest:(LFHTTPRequest *)request receivedBytes:(unsigned int)bytesReceived expectedTotal:(unsigned int)total; 160 | - (void)httpRequest:(LFHTTPRequest *)request sentBytes:(unsigned int)bytesSent total:(unsigned int)total; 161 | - (void)httpRequest:(LFHTTPRequest *)request writeReceivedBytes:(void *)bytes size:(unsigned int)blockSize expectedTotal:(unsigned int)total; 162 | #endif 163 | @end -------------------------------------------------------------------------------- /Source/ObjectiveFlickr.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectiveFlickr.h 3 | // 4 | // Copyright (c) 2006-2014 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "LFWebAPIKit.h" 29 | #import "OFUtilities.h" 30 | #import "OFXMLMapper.h" 31 | 32 | extern NSString *const OFFlickrSmallSquareSize; // "s" - 75x75 33 | extern NSString *const OFFlickrLargeSquareSize; // "q" - 150x150 34 | extern NSString *const OFFlickrThumbnailSize; // "t" - 100 on longest side 35 | extern NSString *const OFFlickrSmallSize; // "m" - 240 on longest side 36 | extern NSString *const OFFlickrSmallSize320; // "n" - 320 on longest side 37 | extern NSString *const OFFlickrMediumSize; // (no size modifier) - 500 on longest side 38 | extern NSString *const OFFlickrMediumSquareSize640; // "z" - 640x640 39 | extern NSString *const OFFlickrMediumSquareSize800; // "c" - 800x800 40 | extern NSString *const OFFlickrLargeSize; // "b" - 1024 on longest side 41 | 42 | extern NSString *const OFFlickrReadPermission; 43 | extern NSString *const OFFlickrWritePermission; 44 | extern NSString *const OFFlickrDeletePermission; 45 | 46 | @interface OFFlickrAPIContext : NSObject 47 | { 48 | NSString *key; 49 | NSString *sharedSecret; 50 | NSString *authToken; 51 | 52 | NSString *RESTAPIEndpoint; 53 | NSString *photoSource; 54 | NSString *photoWebPageSource; 55 | NSString *authEndpoint; 56 | NSString *uploadEndpoint; 57 | 58 | NSString *oauthToken; 59 | NSString *oauthTokenSecret; 60 | } 61 | - (id)initWithAPIKey:(NSString *)inKey sharedSecret:(NSString *)inSharedSecret; 62 | 63 | // OAuth URL 64 | - (NSURL *)userAuthorizationURLWithRequestToken:(NSString *)inRequestToken requestedPermission:(NSString *)inPermission; 65 | 66 | 67 | // URL provisioning 68 | - (NSURL *)photoSourceURLFromDictionary:(NSDictionary *)inDictionary size:(NSString *)inSizeModifier; 69 | - (NSURL *)photoWebPageURLFromDictionary:(NSDictionary *)inDictionary; 70 | - (NSURL *)loginURLFromFrobDictionary:(NSDictionary *)inFrob requestedPermission:(NSString *)inPermission; 71 | 72 | // API endpoints 73 | 74 | @property (nonatomic, readonly) NSString *key; 75 | @property (nonatomic, readonly) NSString *sharedSecret; 76 | @property (nonatomic, retain) NSString *authToken; 77 | 78 | @property (nonatomic, retain) NSString *RESTAPIEndpoint; 79 | @property (nonatomic, retain) NSString *photoSource; 80 | @property (nonatomic, retain) NSString *photoWebPageSource; 81 | @property (nonatomic, retain) NSString *authEndpoint; 82 | @property (nonatomic, retain) NSString *uploadEndpoint; 83 | 84 | @property (nonatomic, retain) NSString *OAuthToken; 85 | @property (nonatomic, retain) NSString *OAuthTokenSecret; 86 | @end 87 | 88 | extern NSString *const OFFlickrAPIReturnedErrorDomain; 89 | extern NSString *const OFFlickrAPIRequestErrorDomain; 90 | 91 | enum { 92 | // refer to Flickr API document for Flickr's own error codes 93 | OFFlickrAPIRequestConnectionError = 0x7fff0001, 94 | OFFlickrAPIRequestTimeoutError = 0x7fff0002, 95 | OFFlickrAPIRequestFaultyXMLResponseError = 0x7fff0003, 96 | 97 | OFFlickrAPIRequestOAuthError = 0x7fff0004, 98 | 99 | OFFlickrAPIRequestUnknownError = 0x7fff0042 100 | }; 101 | 102 | extern NSString *const OFFlickrAPIRequestOAuthErrorUserInfoKey; 103 | 104 | extern NSString *const OFFetchOAuthRequestTokenSession; 105 | extern NSString *const OFFetchOAuthAccessTokenSession; 106 | 107 | 108 | @class OFFlickrAPIRequest; 109 | 110 | @protocol OFFlickrAPIRequestDelegate 111 | @optional 112 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary; 113 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didFailWithError:(NSError *)inError; 114 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest imageUploadSentBytes:(NSUInteger)inSentBytes totalBytes:(NSUInteger)inTotalBytes; 115 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didObtainOAuthRequestToken:(NSString *)inRequestToken secret:(NSString *)inSecret; 116 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didObtainOAuthAccessToken:(NSString *)inAccessToken secret:(NSString *)inSecret userFullName:(NSString *)inFullName userName:(NSString *)inUserName userNSID:(NSString *)inNSID; 117 | 118 | @end 119 | 120 | typedef id OFFlickrAPIRequestDelegateType; 121 | 122 | @interface OFFlickrAPIRequest : NSObject 123 | { 124 | OFFlickrAPIContext *context; 125 | LFHTTPRequest *HTTPRequest; 126 | 127 | OFFlickrAPIRequestDelegateType delegate; 128 | id sessionInfo; 129 | 130 | NSString *uploadTempFilename; 131 | 132 | id oauthState; 133 | } 134 | - (id)initWithAPIContext:(OFFlickrAPIContext *)inContext; 135 | - (OFFlickrAPIContext *)context; 136 | 137 | 138 | - (NSTimeInterval)requestTimeoutInterval; 139 | - (void)setRequestTimeoutInterval:(NSTimeInterval)inTimeInterval; 140 | - (BOOL)isRunning; 141 | - (void)cancel; 142 | 143 | // oauth methods 144 | - (BOOL)fetchOAuthRequestTokenWithCallbackURL:(NSURL *)inCallbackURL; 145 | - (BOOL)fetchOAuthAccessTokenWithRequestToken:(NSString *)inRequestToken verifier:(NSString *)inVerifier; 146 | 147 | // elementary methods 148 | - (BOOL)callAPIMethodWithGET:(NSString *)inMethodName arguments:(NSDictionary *)inArguments; 149 | - (BOOL)callAPIMethodWithPOST:(NSString *)inMethodName arguments:(NSDictionary *)inArguments; 150 | 151 | // image upload—we use NSInputStream here because we want to have flexibity; with this you can upload either a file or NSData from NSImage 152 | - (BOOL)uploadImageStream:(NSInputStream *)inImageStream suggestedFilename:(NSString *)inFilename MIMEType:(NSString *)inType arguments:(NSDictionary *)inArguments; 153 | 154 | @property (nonatomic, readonly) OFFlickrAPIContext *context; 155 | @property (nonatomic, assign) OFFlickrAPIRequestDelegateType delegate; 156 | @property (nonatomic, retain) id sessionInfo; 157 | @property (nonatomic, assign) NSTimeInterval requestTimeoutInterval; 158 | 159 | @end 160 | -------------------------------------------------------------------------------- /Examples/SnapAndRun-iPhone/Classes/SnapAndRunAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SnapAndRunAppDelegate.m 3 | // 4 | // Copyright (c) 2009 Lukhnos D. Liu (http://lukhnos.org) 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the "Software"), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | 28 | #import "SnapAndRunAppDelegate.h" 29 | #import "SnapAndRunViewController.h" 30 | #import "SampleAPIKey.h" 31 | 32 | NSString *SnapAndRunShouldUpdateAuthInfoNotification = @"SnapAndRunShouldUpdateAuthInfoNotification"; 33 | 34 | // preferably, the auth token is stored in the keychain, but since working with keychain is a pain, we use the simpler default system 35 | NSString *kStoredAuthTokenKeyName = @"FlickrOAuthToken"; 36 | NSString *kStoredAuthTokenSecretKeyName = @"FlickrOAuthTokenSecret"; 37 | 38 | NSString *kGetAccessTokenStep = @"kGetAccessTokenStep"; 39 | NSString *kCheckTokenStep = @"kCheckTokenStep"; 40 | 41 | NSString *SRCallbackURLBaseString = @"snapnrun://auth"; 42 | 43 | @implementation SnapAndRunAppDelegate 44 | - (void)dealloc 45 | { 46 | [viewController release]; 47 | [window release]; 48 | [flickrContext release]; 49 | [flickrRequest release]; 50 | [flickrUserName release]; 51 | [super dealloc]; 52 | } 53 | 54 | - (OFFlickrAPIRequest *)flickrRequest 55 | { 56 | if (!flickrRequest) { 57 | flickrRequest = [[OFFlickrAPIRequest alloc] initWithAPIContext:self.flickrContext]; 58 | flickrRequest.delegate = self; 59 | } 60 | 61 | return flickrRequest; 62 | } 63 | 64 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 65 | { 66 | if ([self flickrRequest].sessionInfo) { 67 | // already running some other request 68 | NSLog(@"Already running some other request"); 69 | } 70 | else { 71 | NSString *token = nil; 72 | NSString *verifier = nil; 73 | BOOL result = OFExtractOAuthCallback(url, [NSURL URLWithString:SRCallbackURLBaseString], &token, &verifier); 74 | 75 | if (!result) { 76 | NSLog(@"Cannot obtain token/secret from URL: %@", [url absoluteString]); 77 | return NO; 78 | } 79 | 80 | [self flickrRequest].sessionInfo = kGetAccessTokenStep; 81 | [flickrRequest fetchOAuthAccessTokenWithRequestToken:token verifier:verifier]; 82 | [activityIndicator startAnimating]; 83 | [viewController.view addSubview:progressView]; 84 | } 85 | 86 | return YES; 87 | } 88 | 89 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 90 | { 91 | [window addSubview:viewController.view]; 92 | [window makeKeyAndVisible]; 93 | 94 | if ([self.flickrContext.OAuthToken length]) { 95 | [self flickrRequest].sessionInfo = kCheckTokenStep; 96 | [flickrRequest callAPIMethodWithGET:@"flickr.test.login" arguments:nil]; 97 | 98 | [activityIndicator startAnimating]; 99 | [viewController.view addSubview:progressView]; 100 | } 101 | return YES; 102 | } 103 | 104 | + (SnapAndRunAppDelegate *)sharedDelegate 105 | { 106 | return (SnapAndRunAppDelegate *)[[UIApplication sharedApplication] delegate]; 107 | } 108 | 109 | - (void)cancelAction 110 | { 111 | [flickrRequest cancel]; 112 | [activityIndicator stopAnimating]; 113 | [progressView removeFromSuperview]; 114 | [self setAndStoreFlickrAuthToken:nil secret:nil]; 115 | [[NSNotificationCenter defaultCenter] postNotificationName:SnapAndRunShouldUpdateAuthInfoNotification object:self]; 116 | } 117 | 118 | - (void)setAndStoreFlickrAuthToken:(NSString *)inAuthToken secret:(NSString *)inSecret 119 | { 120 | if (![inAuthToken length] || ![inSecret length]) { 121 | self.flickrContext.OAuthToken = nil; 122 | self.flickrContext.OAuthTokenSecret = nil; 123 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:kStoredAuthTokenKeyName]; 124 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:kStoredAuthTokenSecretKeyName]; 125 | 126 | } 127 | else { 128 | self.flickrContext.OAuthToken = inAuthToken; 129 | self.flickrContext.OAuthTokenSecret = inSecret; 130 | [[NSUserDefaults standardUserDefaults] setObject:inAuthToken forKey:kStoredAuthTokenKeyName]; 131 | [[NSUserDefaults standardUserDefaults] setObject:inSecret forKey:kStoredAuthTokenSecretKeyName]; 132 | } 133 | } 134 | 135 | - (OFFlickrAPIContext *)flickrContext 136 | { 137 | if (!flickrContext) { 138 | flickrContext = [[OFFlickrAPIContext alloc] initWithAPIKey:OBJECTIVE_FLICKR_SAMPLE_API_KEY sharedSecret:OBJECTIVE_FLICKR_SAMPLE_API_SHARED_SECRET]; 139 | 140 | NSString *authToken = [[NSUserDefaults standardUserDefaults] objectForKey:kStoredAuthTokenKeyName]; 141 | NSString *authTokenSecret = [[NSUserDefaults standardUserDefaults] objectForKey:kStoredAuthTokenSecretKeyName]; 142 | 143 | if (([authToken length] > 0) && ([authTokenSecret length] > 0)) { 144 | flickrContext.OAuthToken = authToken; 145 | flickrContext.OAuthTokenSecret = authTokenSecret; 146 | } 147 | } 148 | 149 | return flickrContext; 150 | } 151 | 152 | #pragma mark OFFlickrAPIRequest delegate methods 153 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didObtainOAuthAccessToken:(NSString *)inAccessToken secret:(NSString *)inSecret userFullName:(NSString *)inFullName userName:(NSString *)inUserName userNSID:(NSString *)inNSID 154 | { 155 | [self setAndStoreFlickrAuthToken:inAccessToken secret:inSecret]; 156 | self.flickrUserName = inUserName; 157 | 158 | [activityIndicator stopAnimating]; 159 | [progressView removeFromSuperview]; 160 | [[NSNotificationCenter defaultCenter] postNotificationName:SnapAndRunShouldUpdateAuthInfoNotification object:self]; 161 | [self flickrRequest].sessionInfo = nil; 162 | } 163 | 164 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary 165 | { 166 | if (inRequest.sessionInfo == kCheckTokenStep) { 167 | self.flickrUserName = [inResponseDictionary valueForKeyPath:@"user.username._text"]; 168 | } 169 | 170 | [activityIndicator stopAnimating]; 171 | [progressView removeFromSuperview]; 172 | [[NSNotificationCenter defaultCenter] postNotificationName:SnapAndRunShouldUpdateAuthInfoNotification object:self]; 173 | [self flickrRequest].sessionInfo = nil; 174 | } 175 | 176 | - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didFailWithError:(NSError *)inError 177 | { 178 | if (inRequest.sessionInfo == kGetAccessTokenStep) { 179 | } 180 | else if (inRequest.sessionInfo == kCheckTokenStep) { 181 | [self setAndStoreFlickrAuthToken:nil secret:nil]; 182 | } 183 | 184 | [activityIndicator stopAnimating]; 185 | [progressView removeFromSuperview]; 186 | 187 | [[[[UIAlertView alloc] initWithTitle:@"API Failed" message:[inError description] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] autorelease] show]; 188 | [[NSNotificationCenter defaultCenter] postNotificationName:SnapAndRunShouldUpdateAuthInfoNotification object:self]; 189 | } 190 | 191 | @synthesize viewController; 192 | @synthesize window; 193 | @synthesize flickrContext; 194 | @synthesize flickrUserName; 195 | 196 | @synthesize activityIndicator; 197 | @synthesize progressView; 198 | @synthesize cancelButton; 199 | @synthesize progressDescription; 200 | @end 201 | -------------------------------------------------------------------------------- /LFWebAPIKit/LFSiteReachability.m: -------------------------------------------------------------------------------- 1 | // 2 | // LFSiteReachability.m 3 | // 4 | // Copyright (c) 2007-2009 Lithoglyph Inc. (http://lithoglyph.com) 5 | // Copyright (c) 2007-2009 Lukhnos D. Liu (http://lukhnos.org) 6 | // 7 | // Permission is hereby granted, free of charge, to any person 8 | // obtaining a copy of this software and associated documentation 9 | // files (the "Software"), to deal in the Software without 10 | // restriction, including without limitation the rights to use, 11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following 14 | // conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be 17 | // included in all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | // OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | #import "LFSiteReachability.h" 30 | #import 31 | 32 | static NSString *kDefaultSite = @"http://google.com"; 33 | static NSTimeInterval kDefaultTimeoutInterval = 15.0; 34 | 35 | #define LFSRDebug(format, ...) 36 | // #define LFSRDebug NSLog 37 | 38 | NSString *const LFSiteReachabilityConnectionTypeWiFi = @"LFSiteReachabilityConnectionTypeWiFi"; 39 | NSString *const LFSiteReachabilityConnectionTypeWWAN = @"LFSiteReachabilityConnectionTypeWWAN"; 40 | NSString *const LFSiteReachabilityNotReachableStatus = @"LFSiteReachabilityNotReachable"; 41 | 42 | #if !TARGET_OS_IPHONE 43 | #define SCNetworkReachabilityFlags SCNetworkConnectionFlags 44 | #define kSCNetworkReachabilityFlagsConnectionRequired kSCNetworkFlagsConnectionRequired 45 | #define kSCNetworkReachabilityFlagsReachable kSCNetworkFlagsReachable 46 | #define kSCNetworkReachabilityFlagsIsWWAN 0 47 | #endif 48 | 49 | static void LFSiteReachabilityCallback(SCNetworkReachabilityRef inTarget, SCNetworkReachabilityFlags inFlags, void *inInfo); 50 | 51 | @implementation LFSiteReachability 52 | - (void)dealloc 53 | { 54 | delegate = nil; 55 | 56 | [siteRequest setDelegate:nil]; 57 | [self stopChecking]; 58 | [siteRequest release]; 59 | [siteURL release]; 60 | 61 | [super dealloc]; 62 | } 63 | 64 | - (void)finalize 65 | { 66 | [siteRequest setDelegate:nil]; 67 | [self stopChecking]; 68 | [super finalize]; 69 | } 70 | 71 | - (id)init 72 | { 73 | if ((self = [super init])) { 74 | siteRequest = [[LFHTTPRequest alloc] init]; 75 | [siteRequest setDelegate:self]; 76 | [siteRequest setTimeoutInterval:kDefaultTimeoutInterval]; 77 | 78 | siteURL = [[NSURL URLWithString:kDefaultSite] retain]; 79 | } 80 | 81 | return self; 82 | } 83 | 84 | - (void)handleTimeoutTimer:(NSTimer *)inTimer 85 | { 86 | LFSRDebug(@"%s", __PRETTY_FUNCTION__); 87 | [inTimer invalidate]; 88 | 89 | if (lastCheckStatus != LFSiteReachabilityNotReachableStatus) { 90 | lastCheckStatus = LFSiteReachabilityNotReachableStatus; 91 | if ([delegate respondsToSelector:@selector(reachability:siteIsNotAvailable:)]) { 92 | [delegate reachability:self siteIsNotAvailable:siteURL]; 93 | } 94 | } 95 | } 96 | 97 | - (void)stopTimeoutTimer 98 | { 99 | if ([timeoutTimer isValid]) { 100 | [timeoutTimer invalidate]; 101 | } 102 | 103 | [timeoutTimer release]; 104 | timeoutTimer = nil; 105 | } 106 | 107 | - (void)handleReachabilityCallbackFlags:(SCNetworkReachabilityFlags)inFlags 108 | { 109 | [self stopTimeoutTimer]; 110 | 111 | LFSRDebug(@"%s, flags: 0x%08x", __PRETTY_FUNCTION__, inFlags); 112 | 113 | if (inFlags & kSCNetworkReachabilityFlagsReachable) { 114 | NSString *connectionType = (inFlags & kSCNetworkReachabilityFlagsIsWWAN) ? LFSiteReachabilityConnectionTypeWWAN : LFSiteReachabilityConnectionTypeWiFi; 115 | 116 | BOOL connectionRequestNotRequired = !(inFlags & kSCNetworkReachabilityFlagsConnectionRequired); 117 | 118 | if (siteURL) { 119 | LFSRDebug(@"%s, connectionRequestNotRequired: %d, attempting to request from: %@", __PRETTY_FUNCTION__, connectionRequestNotRequired, siteURL); 120 | 121 | // next stage: send the request 122 | [siteRequest cancelWithoutDelegateMessage]; 123 | [siteRequest setSessionInfo:connectionType]; 124 | if ([siteRequest performMethod:LFHTTPRequestHEADMethod onURL:siteURL withData:nil]) { 125 | return; 126 | } 127 | } 128 | else { 129 | if (lastCheckStatus != connectionType) { 130 | lastCheckStatus = connectionType; 131 | if (connectionRequestNotRequired && [delegate respondsToSelector:@selector(reachability:site:isAvailableOverConnectionType:)]) { 132 | [delegate reachability:self site:siteURL isAvailableOverConnectionType:connectionType]; 133 | return; 134 | } 135 | } 136 | } 137 | } 138 | 139 | // if all fails 140 | if (lastCheckStatus != LFSiteReachabilityNotReachableStatus) { 141 | lastCheckStatus = LFSiteReachabilityNotReachableStatus; 142 | if ([delegate respondsToSelector:@selector(reachability:siteIsNotAvailable:)]) { 143 | [delegate reachability:self siteIsNotAvailable:siteURL]; 144 | } 145 | } 146 | } 147 | 148 | - (BOOL)networkConnectivityExists 149 | { 150 | // 0.0.0.0 151 | struct sockaddr_in zeroAddress; 152 | bzero(&zeroAddress, sizeof(zeroAddress)); 153 | zeroAddress.sin_len = sizeof(zeroAddress); 154 | zeroAddress.sin_family = AF_INET; 155 | 156 | SCNetworkReachabilityRef localReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); 157 | SCNetworkReachabilityFlags flags = 0; 158 | 159 | BOOL capable = NO; 160 | if (SCNetworkReachabilityGetFlags(localReachability, &flags)) { 161 | if (flags & kSCNetworkReachabilityFlagsReachable) { 162 | capable = YES; 163 | } 164 | } 165 | 166 | CFRelease(localReachability); 167 | return capable; 168 | } 169 | 170 | - (void)startChecking 171 | { 172 | [self stopChecking]; 173 | 174 | // 0.0.0.0 175 | struct sockaddr_in zeroAddress; 176 | bzero(&zeroAddress, sizeof(zeroAddress)); 177 | zeroAddress.sin_len = sizeof(zeroAddress); 178 | zeroAddress.sin_family = AF_INET; 179 | 180 | reachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); 181 | SCNetworkReachabilityFlags flags = 0; 182 | 183 | BOOL createTimeoutTimer = YES; 184 | if (SCNetworkReachabilityGetFlags(reachability, &flags)) { 185 | [self handleReachabilityCallbackFlags:flags]; 186 | createTimeoutTimer = NO; 187 | } 188 | 189 | SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; 190 | SCNetworkReachabilitySetCallback(reachability, LFSiteReachabilityCallback, &context); 191 | SCNetworkReachabilityScheduleWithRunLoop(reachability, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); 192 | 193 | if (createTimeoutTimer) { 194 | timeoutTimer = [[NSTimer scheduledTimerWithTimeInterval:[siteRequest timeoutInterval] target:self selector:@selector(handleTimeoutTimer:) userInfo:NULL repeats:NO] retain]; 195 | } 196 | } 197 | 198 | - (void)stopChecking 199 | { 200 | [siteRequest cancelWithoutDelegateMessage]; 201 | [self stopTimeoutTimer]; 202 | 203 | if (reachability) { 204 | SCNetworkReachabilityUnscheduleFromRunLoop(reachability, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); 205 | CFRelease(reachability); 206 | reachability = NULL; 207 | } 208 | 209 | lastCheckStatus = nil; 210 | } 211 | 212 | - (BOOL)isChecking 213 | { 214 | return !!reachability; 215 | } 216 | 217 | - (NSTimeInterval)timeoutInterval 218 | { 219 | return [siteRequest timeoutInterval]; 220 | } 221 | 222 | - (void)setTimeoutInterval:(NSTimeInterval)inInterval 223 | { 224 | [siteRequest setTimeoutInterval:inInterval]; 225 | } 226 | 227 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 228 | - (void)httpRequest:(LFHTTPRequest *)request didReceiveStatusCode:(int)statusCode URL:(NSURL *)url responseHeader:(CFHTTPMessageRef)header 229 | #else 230 | - (void)httpRequest:(LFHTTPRequest *)request didReceiveStatusCode:(NSUInteger)statusCode URL:(NSURL *)url responseHeader:(CFHTTPMessageRef)header 231 | #endif 232 | { 233 | LFSRDebug(@"%s, code: %d, URL: %@, header: %@", __PRETTY_FUNCTION__, statusCode, url, (id)header); 234 | } 235 | 236 | - (void)httpRequestDidComplete:(LFHTTPRequest *)request 237 | { 238 | LFSRDebug(@"%s, connection type: %@, received data: %@", __PRETTY_FUNCTION__, [request sessionInfo], [request receivedData]); 239 | 240 | if (lastCheckStatus != [request sessionInfo]) { 241 | lastCheckStatus = [request sessionInfo]; 242 | if ([delegate respondsToSelector:@selector(reachability:site:isAvailableOverConnectionType:)]) { 243 | [delegate reachability:self site:siteURL isAvailableOverConnectionType:[request sessionInfo]]; 244 | } 245 | } 246 | } 247 | 248 | - (void)httpRequest:(LFHTTPRequest *)request didFailWithError:(NSString *)error 249 | { 250 | LFSRDebug(@"%s, error: %@", __PRETTY_FUNCTION__, error); 251 | 252 | if (lastCheckStatus != LFSiteReachabilityNotReachableStatus) { 253 | lastCheckStatus = LFSiteReachabilityNotReachableStatus; 254 | if ([delegate respondsToSelector:@selector(reachability:siteIsNotAvailable:)]) { 255 | [delegate reachability:self siteIsNotAvailable:siteURL]; 256 | } 257 | } 258 | } 259 | 260 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 261 | - (id)delegate 262 | { 263 | return delegate; 264 | } 265 | 266 | - (NSURL*)siteURL 267 | { 268 | return [[siteURL retain] autorelease]; 269 | } 270 | 271 | #else 272 | @synthesize delegate; 273 | @synthesize siteURL; 274 | #endif 275 | @end 276 | 277 | 278 | void LFSiteReachabilityCallback(SCNetworkReachabilityRef inTarget, SCNetworkReachabilityFlags inFlags, void *inInfo) 279 | { 280 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 281 | LFSRDebug(@"%s, flags: 0x%08x", __PRETTY_FUNCTION__, inFlags); 282 | 283 | [(LFSiteReachability *)inInfo handleReachabilityCallbackFlags:inFlags]; 284 | [pool drain]; 285 | } 286 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SiteReachability-iPhone/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 768 5 | 10A288 6 | 715 7 | 1010 8 | 411.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 46 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | 35 | 36 | IBFirstResponder 37 | 38 | 39 | 40 | SiteReachabilityViewController 41 | 42 | 43 | 44 | 45 | 292 46 | {320, 480} 47 | 48 | 1 49 | MSAxIDEAA 50 | 51 | NO 52 | NO 53 | 54 | 55 | 56 | 57 | 58 | YES 59 | 60 | 61 | delegate 62 | 63 | 64 | 65 | 4 66 | 67 | 68 | 69 | viewController 70 | 71 | 72 | 73 | 11 74 | 75 | 76 | 77 | window 78 | 79 | 80 | 81 | 14 82 | 83 | 84 | 85 | 86 | YES 87 | 88 | 0 89 | 90 | 91 | 92 | 93 | 94 | -1 95 | 96 | 97 | File's Owner 98 | 99 | 100 | 3 101 | 102 | 103 | SiteReachability App Delegate 104 | 105 | 106 | -2 107 | 108 | 109 | 110 | 111 | 10 112 | 113 | 114 | 115 | 116 | 12 117 | 118 | 119 | 120 | 121 | 122 | 123 | YES 124 | 125 | YES 126 | -1.CustomClassName 127 | -2.CustomClassName 128 | 10.CustomClassName 129 | 10.IBEditorWindowLastContentRect 130 | 10.IBPluginDependency 131 | 12.IBEditorWindowLastContentRect 132 | 12.IBPluginDependency 133 | 3.CustomClassName 134 | 3.IBPluginDependency 135 | 136 | 137 | YES 138 | UIApplication 139 | UIResponder 140 | SiteReachabilityViewController 141 | {{512, 351}, {320, 480}} 142 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 143 | {{525, 346}, {320, 480}} 144 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 145 | SiteReachabilityAppDelegate 146 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 147 | 148 | 149 | 150 | YES 151 | 152 | 153 | YES 154 | 155 | 156 | 157 | 158 | YES 159 | 160 | 161 | YES 162 | 163 | 164 | 165 | 14 166 | 167 | 168 | 169 | YES 170 | 171 | SiteReachabilityAppDelegate 172 | NSObject 173 | 174 | YES 175 | 176 | YES 177 | viewController 178 | window 179 | 180 | 181 | YES 182 | SiteReachabilityViewController 183 | UIWindow 184 | 185 | 186 | 187 | IBProjectSource 188 | Classes/SiteReachabilityAppDelegate.h 189 | 190 | 191 | 192 | SiteReachabilityAppDelegate 193 | NSObject 194 | 195 | IBUserSource 196 | 197 | 198 | 199 | 200 | SiteReachabilityViewController 201 | UIViewController 202 | 203 | IBProjectSource 204 | Classes/SiteReachabilityViewController.h 205 | 206 | 207 | 208 | 209 | 0 210 | 211 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 212 | 213 | 214 | YES 215 | SiteReachability.xcodeproj 216 | 3 217 | 218 | 219 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/StreamedBodySendingTest/GoogleToolboxForMac-Part/GTMDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMDefines.h 3 | // 4 | // Copyright 2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | // ============================================================================ 20 | 21 | #include 22 | #include 23 | 24 | // Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs 25 | #ifndef MAC_OS_X_VERSION_10_5 26 | #define MAC_OS_X_VERSION_10_5 1050 27 | #endif 28 | #ifndef MAC_OS_X_VERSION_10_6 29 | #define MAC_OS_X_VERSION_10_6 1060 30 | #endif 31 | 32 | // ---------------------------------------------------------------------------- 33 | // CPP symbols that can be overridden in a prefix to control how the toolbox 34 | // is compiled. 35 | // ---------------------------------------------------------------------------- 36 | 37 | 38 | // By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and 39 | // GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens 40 | // when a validation fails. If you implement your own validators, you may want 41 | // to control their internals using the same macros for consistency. 42 | #ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 43 | #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 44 | #endif 45 | 46 | // Give ourselves a consistent way to do inlines. Apple's macros even use 47 | // a few different actual definitions, so we're based off of the foundation 48 | // one. 49 | #if !defined(GTM_INLINE) 50 | #if defined (__GNUC__) && (__GNUC__ == 4) 51 | #define GTM_INLINE static __inline__ __attribute__((always_inline)) 52 | #else 53 | #define GTM_INLINE static __inline__ 54 | #endif 55 | #endif 56 | 57 | // Give ourselves a consistent way of doing externs that links up nicely 58 | // when mixing objc and objc++ 59 | #if !defined (GTM_EXTERN) 60 | #if defined __cplusplus 61 | #define GTM_EXTERN extern "C" 62 | #else 63 | #define GTM_EXTERN extern 64 | #endif 65 | #endif 66 | 67 | // Give ourselves a consistent way of exporting things if we have visibility 68 | // set to hidden. 69 | #if !defined (GTM_EXPORT) 70 | #define GTM_EXPORT __attribute__((visibility("default"))) 71 | #endif 72 | 73 | // _GTMDevLog & _GTMDevAssert 74 | // 75 | // _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for 76 | // developer level errors. This implementation simply macros to NSLog/NSAssert. 77 | // It is not intended to be a general logging/reporting system. 78 | // 79 | // Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert 80 | // for a little more background on the usage of these macros. 81 | // 82 | // _GTMDevLog log some error/problem in debug builds 83 | // _GTMDevAssert assert if conditon isn't met w/in a method/function 84 | // in all builds. 85 | // 86 | // To replace this system, just provide different macro definitions in your 87 | // prefix header. Remember, any implementation you provide *must* be thread 88 | // safe since this could be called by anything in what ever situtation it has 89 | // been placed in. 90 | // 91 | 92 | // We only define the simple macros if nothing else has defined this. 93 | #ifndef _GTMDevLog 94 | 95 | #ifdef DEBUG 96 | #define _GTMDevLog(...) NSLog(__VA_ARGS__) 97 | #else 98 | #define _GTMDevLog(...) do { } while (0) 99 | #endif 100 | 101 | #endif // _GTMDevLog 102 | 103 | // Declared here so that it can easily be used for logging tracking if 104 | // necessary. See GTMUnitTestDevLog.h for details. 105 | @class NSString; 106 | GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...); 107 | 108 | #ifndef _GTMDevAssert 109 | // we directly invoke the NSAssert handler so we can pass on the varargs 110 | // (NSAssert doesn't have a macro we can use that takes varargs) 111 | #if !defined(NS_BLOCK_ASSERTIONS) 112 | #define _GTMDevAssert(condition, ...) \ 113 | do { \ 114 | if (!(condition)) { \ 115 | [[NSAssertionHandler currentHandler] \ 116 | handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ 117 | file:[NSString stringWithUTF8String:__FILE__] \ 118 | lineNumber:__LINE__ \ 119 | description:__VA_ARGS__]; \ 120 | } \ 121 | } while(0) 122 | #else // !defined(NS_BLOCK_ASSERTIONS) 123 | #define _GTMDevAssert(condition, ...) do { } while (0) 124 | #endif // !defined(NS_BLOCK_ASSERTIONS) 125 | 126 | #endif // _GTMDevAssert 127 | 128 | // _GTMCompileAssert 129 | // _GTMCompileAssert is an assert that is meant to fire at compile time if you 130 | // want to check things at compile instead of runtime. For example if you 131 | // want to check that a wchar is 4 bytes instead of 2 you would use 132 | // _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) 133 | // Note that the second "arg" is not in quotes, and must be a valid processor 134 | // symbol in it's own right (no spaces, punctuation etc). 135 | 136 | // Wrapping this in an #ifndef allows external groups to define their own 137 | // compile time assert scheme. 138 | #ifndef _GTMCompileAssert 139 | // We got this technique from here: 140 | // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html 141 | 142 | #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg 143 | #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) 144 | #define _GTMCompileAssert(test, msg) \ 145 | typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] 146 | #endif // _GTMCompileAssert 147 | 148 | // Macro to allow fast enumeration when building for 10.5 or later, and 149 | // reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration 150 | // does keys, so pick the right thing, nothing is done on the FastEnumeration 151 | // side to be sure you're getting what you wanted. 152 | #ifndef GTM_FOREACH_OBJECT 153 | #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) 154 | #define GTM_FOREACH_OBJECT(element, collection) \ 155 | for (element in collection) 156 | #define GTM_FOREACH_KEY(element, collection) \ 157 | for (element in collection) 158 | #else 159 | #define GTM_FOREACH_OBJECT(element, collection) \ 160 | for (NSEnumerator * _ ## element ## _enum = [collection objectEnumerator]; \ 161 | (element = [_ ## element ## _enum nextObject]) != nil; ) 162 | #define GTM_FOREACH_KEY(element, collection) \ 163 | for (NSEnumerator * _ ## element ## _enum = [collection keyEnumerator]; \ 164 | (element = [_ ## element ## _enum nextObject]) != nil; ) 165 | #endif 166 | #endif 167 | 168 | // ============================================================================ 169 | 170 | // ---------------------------------------------------------------------------- 171 | // CPP symbols defined based on the project settings so the GTM code has 172 | // simple things to test against w/o scattering the knowledge of project 173 | // setting through all the code. 174 | // ---------------------------------------------------------------------------- 175 | 176 | // Provide a single constant CPP symbol that all of GTM uses for ifdefing 177 | // iPhone code. 178 | #if TARGET_OS_IPHONE // iPhone SDK 179 | // For iPhone specific stuff 180 | #define GTM_IPHONE_SDK 1 181 | #if TARGET_IPHONE_SIMULATOR 182 | #define GTM_IPHONE_SIMULATOR 1 183 | #else 184 | #define GTM_IPHONE_DEVICE 1 185 | #endif // TARGET_IPHONE_SIMULATOR 186 | #else 187 | // For MacOS specific stuff 188 | #define GTM_MACOS_SDK 1 189 | #endif 190 | 191 | // Provide a symbol to include/exclude extra code for GC support. (This mainly 192 | // just controls the inclusion of finalize methods). 193 | #ifndef GTM_SUPPORT_GC 194 | #if GTM_IPHONE_SDK 195 | // iPhone never needs GC 196 | #define GTM_SUPPORT_GC 0 197 | #else 198 | // We can't find a symbol to tell if GC is supported/required, so best we 199 | // do on Mac targets is include it if we're on 10.5 or later. 200 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 201 | #define GTM_SUPPORT_GC 0 202 | #else 203 | #define GTM_SUPPORT_GC 1 204 | #endif 205 | #endif 206 | #endif 207 | 208 | // To simplify support for 64bit (and Leopard in general), we provide the type 209 | // defines for non Leopard SDKs 210 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 211 | // NSInteger/NSUInteger and Max/Mins 212 | #ifndef NSINTEGER_DEFINED 213 | #if __LP64__ || NS_BUILD_32_LIKE_64 214 | typedef long NSInteger; 215 | typedef unsigned long NSUInteger; 216 | #else 217 | typedef int NSInteger; 218 | typedef unsigned int NSUInteger; 219 | #endif 220 | #define NSIntegerMax LONG_MAX 221 | #define NSIntegerMin LONG_MIN 222 | #define NSUIntegerMax ULONG_MAX 223 | #define NSINTEGER_DEFINED 1 224 | #endif // NSINTEGER_DEFINED 225 | // CGFloat 226 | #ifndef CGFLOAT_DEFINED 227 | #if defined(__LP64__) && __LP64__ 228 | // This really is an untested path (64bit on Tiger?) 229 | typedef double CGFloat; 230 | #define CGFLOAT_MIN DBL_MIN 231 | #define CGFLOAT_MAX DBL_MAX 232 | #define CGFLOAT_IS_DOUBLE 1 233 | #else /* !defined(__LP64__) || !__LP64__ */ 234 | typedef float CGFloat; 235 | #define CGFLOAT_MIN FLT_MIN 236 | #define CGFLOAT_MAX FLT_MAX 237 | #define CGFLOAT_IS_DOUBLE 0 238 | #endif /* !defined(__LP64__) || !__LP64__ */ 239 | #define CGFLOAT_DEFINED 1 240 | #endif // CGFLOAT_DEFINED 241 | #endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 242 | -------------------------------------------------------------------------------- /LFWebAPIKit/Tests/SynchronousRequestTest/SynchronousRequestTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6AB623730FE2CB7500AD3BB4 /* LFHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AB6236F0FE2CB7500AD3BB4 /* LFHTTPRequest.m */; }; 11 | 6AB623740FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AB623720FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.m */; }; 12 | 6AB623770FE2CB7F00AD3BB4 /* TestSuite.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AB623760FE2CB7F00AD3BB4 /* TestSuite.m */; }; 13 | 6AB6237B0FE2CC1600AD3BB4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AB6237A0FE2CC1600AD3BB4 /* SystemConfiguration.framework */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 6AB623670FE2CB6800AD3BB4 /* SynchronousRequestTest.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SynchronousRequestTest.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 6AB623690FE2CB6800AD3BB4 /* SynchronousRequestTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SynchronousRequestTest-Info.plist"; sourceTree = ""; }; 19 | 6AB6236E0FE2CB7500AD3BB4 /* LFHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LFHTTPRequest.h; path = ../../LFHTTPRequest.h; sourceTree = SOURCE_ROOT; }; 20 | 6AB6236F0FE2CB7500AD3BB4 /* LFHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LFHTTPRequest.m; path = ../../LFHTTPRequest.m; sourceTree = SOURCE_ROOT; }; 21 | 6AB623700FE2CB7500AD3BB4 /* LFWebAPIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LFWebAPIKit.h; path = ../../LFWebAPIKit.h; sourceTree = SOURCE_ROOT; }; 22 | 6AB623710FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+LFHTTPFormExtensions.h"; path = "../../NSData+LFHTTPFormExtensions.h"; sourceTree = SOURCE_ROOT; }; 23 | 6AB623720FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+LFHTTPFormExtensions.m"; path = "../../NSData+LFHTTPFormExtensions.m"; sourceTree = SOURCE_ROOT; }; 24 | 6AB623750FE2CB7F00AD3BB4 /* TestSuite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSuite.h; sourceTree = ""; }; 25 | 6AB623760FE2CB7F00AD3BB4 /* TestSuite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestSuite.m; sourceTree = ""; }; 26 | 6AB6237A0FE2CC1600AD3BB4 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 6AB623640FE2CB6800AD3BB4 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | 6AB6237B0FE2CC1600AD3BB4 /* SystemConfiguration.framework in Frameworks */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXFrameworksBuildPhase section */ 39 | 40 | /* Begin PBXGroup section */ 41 | 6AB623570FE2CB5700AD3BB4 = { 42 | isa = PBXGroup; 43 | children = ( 44 | 6AB6236E0FE2CB7500AD3BB4 /* LFHTTPRequest.h */, 45 | 6AB6236F0FE2CB7500AD3BB4 /* LFHTTPRequest.m */, 46 | 6AB623700FE2CB7500AD3BB4 /* LFWebAPIKit.h */, 47 | 6AB623710FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.h */, 48 | 6AB623720FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.m */, 49 | 6AB623680FE2CB6800AD3BB4 /* Products */, 50 | 6AB623690FE2CB6800AD3BB4 /* SynchronousRequestTest-Info.plist */, 51 | 6AB623750FE2CB7F00AD3BB4 /* TestSuite.h */, 52 | 6AB623760FE2CB7F00AD3BB4 /* TestSuite.m */, 53 | 6AB6237A0FE2CC1600AD3BB4 /* SystemConfiguration.framework */, 54 | ); 55 | sourceTree = ""; 56 | }; 57 | 6AB623680FE2CB6800AD3BB4 /* Products */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 6AB623670FE2CB6800AD3BB4 /* SynchronousRequestTest.octest */, 61 | ); 62 | name = Products; 63 | sourceTree = ""; 64 | }; 65 | /* End PBXGroup section */ 66 | 67 | /* Begin PBXNativeTarget section */ 68 | 6AB623660FE2CB6800AD3BB4 /* SynchronousRequestTest */ = { 69 | isa = PBXNativeTarget; 70 | buildConfigurationList = 6AB6236C0FE2CB6800AD3BB4 /* Build configuration list for PBXNativeTarget "SynchronousRequestTest" */; 71 | buildPhases = ( 72 | 6AB623620FE2CB6800AD3BB4 /* Resources */, 73 | 6AB623630FE2CB6800AD3BB4 /* Sources */, 74 | 6AB623640FE2CB6800AD3BB4 /* Frameworks */, 75 | 6AB623650FE2CB6800AD3BB4 /* ShellScript */, 76 | ); 77 | buildRules = ( 78 | ); 79 | dependencies = ( 80 | ); 81 | name = SynchronousRequestTest; 82 | productName = SynchronousRequestTest; 83 | productReference = 6AB623670FE2CB6800AD3BB4 /* SynchronousRequestTest.octest */; 84 | productType = "com.apple.product-type.bundle"; 85 | }; 86 | /* End PBXNativeTarget section */ 87 | 88 | /* Begin PBXProject section */ 89 | 6AB623590FE2CB5700AD3BB4 /* Project object */ = { 90 | isa = PBXProject; 91 | buildConfigurationList = 6AB6235C0FE2CB5700AD3BB4 /* Build configuration list for PBXProject "SynchronousRequestTest" */; 92 | compatibilityVersion = "Xcode 2.4"; 93 | hasScannedForEncodings = 0; 94 | mainGroup = 6AB623570FE2CB5700AD3BB4; 95 | productRefGroup = 6AB623680FE2CB6800AD3BB4 /* Products */; 96 | projectDirPath = ""; 97 | projectRoot = ""; 98 | targets = ( 99 | 6AB623660FE2CB6800AD3BB4 /* SynchronousRequestTest */, 100 | ); 101 | }; 102 | /* End PBXProject section */ 103 | 104 | /* Begin PBXResourcesBuildPhase section */ 105 | 6AB623620FE2CB6800AD3BB4 /* Resources */ = { 106 | isa = PBXResourcesBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXResourcesBuildPhase section */ 113 | 114 | /* Begin PBXShellScriptBuildPhase section */ 115 | 6AB623650FE2CB6800AD3BB4 /* ShellScript */ = { 116 | isa = PBXShellScriptBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | ); 120 | inputPaths = ( 121 | ); 122 | outputPaths = ( 123 | ); 124 | runOnlyForDeploymentPostprocessing = 0; 125 | shellPath = /bin/sh; 126 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 127 | }; 128 | /* End PBXShellScriptBuildPhase section */ 129 | 130 | /* Begin PBXSourcesBuildPhase section */ 131 | 6AB623630FE2CB6800AD3BB4 /* Sources */ = { 132 | isa = PBXSourcesBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | 6AB623730FE2CB7500AD3BB4 /* LFHTTPRequest.m in Sources */, 136 | 6AB623740FE2CB7500AD3BB4 /* NSData+LFHTTPFormExtensions.m in Sources */, 137 | 6AB623770FE2CB7F00AD3BB4 /* TestSuite.m in Sources */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXSourcesBuildPhase section */ 142 | 143 | /* Begin XCBuildConfiguration section */ 144 | 6AB6235A0FE2CB5700AD3BB4 /* Debug */ = { 145 | isa = XCBuildConfiguration; 146 | buildSettings = { 147 | COPY_PHASE_STRIP = NO; 148 | GCC_ENABLE_OBJC_GC = NO; 149 | }; 150 | name = Debug; 151 | }; 152 | 6AB6235B0FE2CB5700AD3BB4 /* Release */ = { 153 | isa = XCBuildConfiguration; 154 | buildSettings = { 155 | COPY_PHASE_STRIP = YES; 156 | GCC_ENABLE_OBJC_GC = NO; 157 | }; 158 | name = Release; 159 | }; 160 | 6AB6236A0FE2CB6800AD3BB4 /* Debug */ = { 161 | isa = XCBuildConfiguration; 162 | buildSettings = { 163 | ALWAYS_SEARCH_USER_PATHS = NO; 164 | COPY_PHASE_STRIP = NO; 165 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 166 | GCC_DYNAMIC_NO_PIC = NO; 167 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 168 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 169 | GCC_OPTIMIZATION_LEVEL = 0; 170 | INFOPLIST_FILE = "SynchronousRequestTest-Info.plist"; 171 | OTHER_LDFLAGS = ( 172 | "-framework", 173 | Foundation, 174 | "-framework", 175 | SenTestingKit, 176 | "-framework", 177 | AppKit, 178 | ); 179 | PREBINDING = NO; 180 | PRODUCT_NAME = SynchronousRequestTest; 181 | WRAPPER_EXTENSION = octest; 182 | }; 183 | name = Debug; 184 | }; 185 | 6AB6236B0FE2CB6800AD3BB4 /* Release */ = { 186 | isa = XCBuildConfiguration; 187 | buildSettings = { 188 | ALWAYS_SEARCH_USER_PATHS = NO; 189 | COPY_PHASE_STRIP = YES; 190 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 191 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 192 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 193 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 194 | INFOPLIST_FILE = "SynchronousRequestTest-Info.plist"; 195 | OTHER_LDFLAGS = ( 196 | "-framework", 197 | Foundation, 198 | "-framework", 199 | SenTestingKit, 200 | "-framework", 201 | AppKit, 202 | ); 203 | PREBINDING = NO; 204 | PRODUCT_NAME = SynchronousRequestTest; 205 | WRAPPER_EXTENSION = octest; 206 | ZERO_LINK = NO; 207 | }; 208 | name = Release; 209 | }; 210 | /* End XCBuildConfiguration section */ 211 | 212 | /* Begin XCConfigurationList section */ 213 | 6AB6235C0FE2CB5700AD3BB4 /* Build configuration list for PBXProject "SynchronousRequestTest" */ = { 214 | isa = XCConfigurationList; 215 | buildConfigurations = ( 216 | 6AB6235A0FE2CB5700AD3BB4 /* Debug */, 217 | 6AB6235B0FE2CB5700AD3BB4 /* Release */, 218 | ); 219 | defaultConfigurationIsVisible = 0; 220 | defaultConfigurationName = Release; 221 | }; 222 | 6AB6236C0FE2CB6800AD3BB4 /* Build configuration list for PBXNativeTarget "SynchronousRequestTest" */ = { 223 | isa = XCConfigurationList; 224 | buildConfigurations = ( 225 | 6AB6236A0FE2CB6800AD3BB4 /* Debug */, 226 | 6AB6236B0FE2CB6800AD3BB4 /* Release */, 227 | ); 228 | defaultConfigurationIsVisible = 0; 229 | defaultConfigurationName = Release; 230 | }; 231 | /* End XCConfigurationList section */ 232 | }; 233 | rootObject = 6AB623590FE2CB5700AD3BB4 /* Project object */; 234 | } 235 | -------------------------------------------------------------------------------- /Examples/CommandLineTool/CommandLineTool.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6ABF73300F939D2000B9179E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6ABF732F0F939D2000B9179E /* Foundation.framework */; }; 11 | 6ABF73320F939D2000B9179E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6ABF73310F939D2000B9179E /* SystemConfiguration.framework */; }; 12 | 6ABF73370F939D3600B9179E /* libObjectiveFlickr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6ABF732C0F939CFD00B9179E /* libObjectiveFlickr.a */; }; 13 | 6ABF73480F939D9100B9179E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6ABF73470F939D9100B9179E /* main.m */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | 6ABF732B0F939CFD00B9179E /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = 6ABF73270F939CFD00B9179E /* ObjectiveFlickr.xcodeproj */; 20 | proxyType = 2; 21 | remoteGlobalIDString = 6ABF72E60F939BE600B9179E; 22 | remoteInfo = "ObjectiveFlickr (library)"; 23 | }; 24 | 6ABF732D0F939D0600B9179E /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 6ABF73270F939CFD00B9179E /* ObjectiveFlickr.xcodeproj */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 6ABF72E50F939BE600B9179E; 29 | remoteInfo = "ObjectiveFlickr (library)"; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 6ABF731F0F939CEC00B9179E /* flickr-list-public-photos */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "flickr-list-public-photos"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 6ABF73270F939CFD00B9179E /* ObjectiveFlickr.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ObjectiveFlickr.xcodeproj; path = ../../ObjectiveFlickr.xcodeproj; sourceTree = SOURCE_ROOT; }; 36 | 6ABF732F0F939D2000B9179E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 37 | 6ABF73310F939D2000B9179E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; 38 | 6ABF73470F939D9100B9179E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 6ABF73490F939D9D00B9179E /* SampleAPIKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SampleAPIKey.h; path = ../../SampleAPIKey.h; sourceTree = SOURCE_ROOT; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 6ABF731D0F939CEC00B9179E /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | 6ABF73300F939D2000B9179E /* Foundation.framework in Frameworks */, 48 | 6ABF73320F939D2000B9179E /* SystemConfiguration.framework in Frameworks */, 49 | 6ABF73370F939D3600B9179E /* libObjectiveFlickr.a in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 6ABF73110F939CB100B9179E = { 57 | isa = PBXGroup; 58 | children = ( 59 | 6ABF73490F939D9D00B9179E /* SampleAPIKey.h */, 60 | 6ABF73470F939D9100B9179E /* main.m */, 61 | 6ABF73270F939CFD00B9179E /* ObjectiveFlickr.xcodeproj */, 62 | 6ABF73200F939CEC00B9179E /* Products */, 63 | 6ABF732F0F939D2000B9179E /* Foundation.framework */, 64 | 6ABF73310F939D2000B9179E /* SystemConfiguration.framework */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | 6ABF73200F939CEC00B9179E /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 6ABF731F0F939CEC00B9179E /* flickr-list-public-photos */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | 6ABF73280F939CFD00B9179E /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 6ABF732C0F939CFD00B9179E /* libObjectiveFlickr.a */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | /* End PBXGroup section */ 85 | 86 | /* Begin PBXNativeTarget section */ 87 | 6ABF731E0F939CEC00B9179E /* flickr-list-public-photos */ = { 88 | isa = PBXNativeTarget; 89 | buildConfigurationList = 6ABF73240F939CED00B9179E /* Build configuration list for PBXNativeTarget "flickr-list-public-photos" */; 90 | buildPhases = ( 91 | 6ABF731C0F939CEC00B9179E /* Sources */, 92 | 6ABF731D0F939CEC00B9179E /* Frameworks */, 93 | ); 94 | buildRules = ( 95 | ); 96 | dependencies = ( 97 | 6ABF732E0F939D0600B9179E /* PBXTargetDependency */, 98 | ); 99 | name = "flickr-list-public-photos"; 100 | productName = "flickr-list-public-photos"; 101 | productReference = 6ABF731F0F939CEC00B9179E /* flickr-list-public-photos */; 102 | productType = "com.apple.product-type.tool"; 103 | }; 104 | /* End PBXNativeTarget section */ 105 | 106 | /* Begin PBXProject section */ 107 | 6ABF73130F939CB100B9179E /* Project object */ = { 108 | isa = PBXProject; 109 | buildConfigurationList = 6ABF73160F939CB100B9179E /* Build configuration list for PBXProject "CommandLineTool" */; 110 | compatibilityVersion = "Xcode 2.4"; 111 | hasScannedForEncodings = 0; 112 | mainGroup = 6ABF73110F939CB100B9179E; 113 | productRefGroup = 6ABF73200F939CEC00B9179E /* Products */; 114 | projectDirPath = ""; 115 | projectReferences = ( 116 | { 117 | ProductGroup = 6ABF73280F939CFD00B9179E /* Products */; 118 | ProjectRef = 6ABF73270F939CFD00B9179E /* ObjectiveFlickr.xcodeproj */; 119 | }, 120 | ); 121 | projectRoot = ""; 122 | targets = ( 123 | 6ABF731E0F939CEC00B9179E /* flickr-list-public-photos */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXReferenceProxy section */ 129 | 6ABF732C0F939CFD00B9179E /* libObjectiveFlickr.a */ = { 130 | isa = PBXReferenceProxy; 131 | fileType = archive.ar; 132 | path = libObjectiveFlickr.a; 133 | remoteRef = 6ABF732B0F939CFD00B9179E /* PBXContainerItemProxy */; 134 | sourceTree = BUILT_PRODUCTS_DIR; 135 | }; 136 | /* End PBXReferenceProxy section */ 137 | 138 | /* Begin PBXSourcesBuildPhase section */ 139 | 6ABF731C0F939CEC00B9179E /* Sources */ = { 140 | isa = PBXSourcesBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | 6ABF73480F939D9100B9179E /* main.m in Sources */, 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | /* End PBXSourcesBuildPhase section */ 148 | 149 | /* Begin PBXTargetDependency section */ 150 | 6ABF732E0F939D0600B9179E /* PBXTargetDependency */ = { 151 | isa = PBXTargetDependency; 152 | name = "ObjectiveFlickr (library)"; 153 | targetProxy = 6ABF732D0F939D0600B9179E /* PBXContainerItemProxy */; 154 | }; 155 | /* End PBXTargetDependency section */ 156 | 157 | /* Begin XCBuildConfiguration section */ 158 | 6ABF73140F939CB100B9179E /* Debug */ = { 159 | isa = XCBuildConfiguration; 160 | buildSettings = { 161 | COPY_PHASE_STRIP = NO; 162 | }; 163 | name = Debug; 164 | }; 165 | 6ABF73150F939CB100B9179E /* Release */ = { 166 | isa = XCBuildConfiguration; 167 | buildSettings = { 168 | COPY_PHASE_STRIP = YES; 169 | }; 170 | name = Release; 171 | }; 172 | 6ABF73220F939CED00B9179E /* Debug */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | COPY_PHASE_STRIP = NO; 177 | GCC_DYNAMIC_NO_PIC = NO; 178 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 179 | GCC_MODEL_TUNING = G5; 180 | GCC_OPTIMIZATION_LEVEL = 0; 181 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 182 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 183 | HEADER_SEARCH_PATHS = ( 184 | ../../LFWebAPIKit, 185 | ../../Source, 186 | ); 187 | INSTALL_PATH = /usr/local/bin; 188 | LIBRARY_SEARCH_PATHS = ( 189 | "$(inherited)", 190 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 191 | ); 192 | LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../build/Debug\""; 193 | OTHER_LDFLAGS = ( 194 | "-framework", 195 | Foundation, 196 | "-framework", 197 | AppKit, 198 | ); 199 | PREBINDING = NO; 200 | PRODUCT_NAME = "flickr-list-public-photos"; 201 | }; 202 | name = Debug; 203 | }; 204 | 6ABF73230F939CED00B9179E /* Release */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | COPY_PHASE_STRIP = YES; 209 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 210 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 211 | GCC_MODEL_TUNING = G5; 212 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 213 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 214 | HEADER_SEARCH_PATHS = ( 215 | ../../LFWebAPIKit, 216 | ../../Source, 217 | ); 218 | INSTALL_PATH = /usr/local/bin; 219 | LIBRARY_SEARCH_PATHS = ( 220 | "$(inherited)", 221 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 222 | ); 223 | LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../build/Debug\""; 224 | OTHER_LDFLAGS = ( 225 | "-framework", 226 | Foundation, 227 | "-framework", 228 | AppKit, 229 | ); 230 | PREBINDING = NO; 231 | PRODUCT_NAME = "flickr-list-public-photos"; 232 | ZERO_LINK = NO; 233 | }; 234 | name = Release; 235 | }; 236 | /* End XCBuildConfiguration section */ 237 | 238 | /* Begin XCConfigurationList section */ 239 | 6ABF73160F939CB100B9179E /* Build configuration list for PBXProject "CommandLineTool" */ = { 240 | isa = XCConfigurationList; 241 | buildConfigurations = ( 242 | 6ABF73140F939CB100B9179E /* Debug */, 243 | 6ABF73150F939CB100B9179E /* Release */, 244 | ); 245 | defaultConfigurationIsVisible = 0; 246 | defaultConfigurationName = Release; 247 | }; 248 | 6ABF73240F939CED00B9179E /* Build configuration list for PBXNativeTarget "flickr-list-public-photos" */ = { 249 | isa = XCConfigurationList; 250 | buildConfigurations = ( 251 | 6ABF73220F939CED00B9179E /* Debug */, 252 | 6ABF73230F939CED00B9179E /* Release */, 253 | ); 254 | defaultConfigurationIsVisible = 0; 255 | defaultConfigurationName = Release; 256 | }; 257 | /* End XCConfigurationList section */ 258 | }; 259 | rootObject = 6ABF73130F939CB100B9179E /* Project object */; 260 | } 261 | --------------------------------------------------------------------------------