Skip to content
Browse files

Make the AFNetworking Mac Example work. Fix bug that caused headers t…

…o install in PRODUCTS/usr/local/include on OSX.
  • Loading branch information...
1 parent f4c26ae commit 159dd1fd0eb2a5a2e478f33706690ca4183b0761 @alloy committed Nov 10, 2011
Showing with 24 additions and 1,125 deletions.
  1. +19 −0 Rakefile
  2. +0 −340 examples/AFNetworking Example/AFNetworking Example.xcodeproj/project.pbxproj
  3. +0 −7 .../AFNetworking Example/AFNetworking Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. +0 −10 examples/AFNetworking Example/AFNetworking Example.xcworkspace/contents.xcworkspacedata
  5. +0 −32 examples/AFNetworking Example/AppDelegate.h
  6. +0 −50 examples/AFNetworking Example/AppDelegate.m
  7. +0 −31 examples/AFNetworking Example/Classes/AFGowallaAPIClient.h
  8. +0 −61 examples/AFNetworking Example/Classes/AFGowallaAPIClient.m
  9. +0 −32 examples/AFNetworking Example/Classes/Controllers/NearbySpotsViewController.h
  10. +0 −187 examples/AFNetworking Example/Classes/Controllers/NearbySpotsViewController.m
  11. +0 −45 examples/AFNetworking Example/Classes/Models/Spot.h
  12. +0 −84 examples/AFNetworking Example/Classes/Models/Spot.m
  13. +0 −27 examples/AFNetworking Example/Classes/Views/SpotTableViewCell.h
  14. +0 −66 examples/AFNetworking Example/Classes/Views/SpotTableViewCell.m
  15. BIN examples/AFNetworking Example/Images/placeholder-stamp.png
  16. BIN examples/AFNetworking Example/Images/placeholder-stamp@2x.png
  17. +0 −34 examples/AFNetworking Example/Info.plist
  18. +0 −11 examples/AFNetworking Example/LICENSE
  19. +0 −4 examples/AFNetworking Example/Podfile
  20. +0 −10 examples/AFNetworking Example/Prefix.pch
  21. +0 −31 examples/AFNetworking Example/README.md
  22. +0 −30 examples/AFNetworking Example/main.m
  23. +1 −16 examples/AFNetworking Mac Example/Podfile
  24. +1 −0 examples/AFNetworking iOS Example/AFNetworking iOS Example.xcworkspace/contents.xcworkspacedata
  25. +1 −15 examples/AFNetworking iOS Example/Podfile
  26. +2 −2 lib/cocoapods/xcode/project.rb
View
19 Rakefile
@@ -76,6 +76,25 @@ namespace :spec do
end
end
+desc "Build all examples"
+task :build_examples do
+ require 'pathname'
+ examples = Pathname.new(File.expand_path('../examples', __FILE__))
+ examples.entries.each do |example|
+ next if %w{ . .. ConfigureTest MacRubySample }.include?(example.basename.to_s)
+ example = examples + example
+ next unless example.directory?
+ puts "Building example: #{example}"
+ puts
+ Dir.chdir(example.to_s) do
+ sh "rm -rf Pods DerivedData"
+ sh "../../bin/pod install --verbose"
+ sh "xcodebuild -workspace '#{example.basename}.xcworkspace' -scheme '#{example.basename}'"
+ end
+ puts
+ end
+end
+
desc "Dumps a Xcode project as YAML, meant for diffing"
task :dump_xcodeproj do
require 'yaml'
View
340 examples/AFNetworking Example/AFNetworking Example.xcodeproj/project.pbxproj
@@ -1,340 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 51FFA22614291BC10076824A /* Pods.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 51FFA22514291BC10076824A /* Pods.xcconfig */; };
- 51FFA22B14291C240076824A /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 51FFA22A14291C240076824A /* libPods.a */; };
- F8D25D191396A9D300CF3BD6 /* placeholder-stamp.png in Resources */ = {isa = PBXBuildFile; fileRef = F8D25D171396A9D300CF3BD6 /* placeholder-stamp.png */; };
- F8D25D1A1396A9D300CF3BD6 /* placeholder-stamp@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F8D25D181396A9D300CF3BD6 /* placeholder-stamp@2x.png */; };
- F8DA09D21396ABED0057D0CC /* AFGowallaAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25D1D1396A9DE00CF3BD6 /* AFGowallaAPIClient.m */; };
- F8DA09D41396ABED0057D0CC /* NearbySpotsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09C81396AB690057D0CC /* NearbySpotsViewController.m */; };
- F8DA09D51396ABED0057D0CC /* Spot.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09CB1396AB690057D0CC /* Spot.m */; };
- F8DA09D61396ABED0057D0CC /* SpotTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09CE1396AB690057D0CC /* SpotTableViewCell.m */; };
- F8DA09E41396AC040057D0CC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09E31396AC040057D0CC /* main.m */; };
- F8DA09E81396AC220057D0CC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09E71396AC220057D0CC /* AppDelegate.m */; };
- F8E469651395739D00DB05C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469641395739D00DB05C8 /* UIKit.framework */; };
- F8E469671395739D00DB05C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469661395739D00DB05C8 /* Foundation.framework */; };
- F8E469691395739D00DB05C8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469681395739D00DB05C8 /* CoreGraphics.framework */; };
- F8E469DF13957DD500DB05C8 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469DE13957DD500DB05C8 /* CoreLocation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 51FFA22514291BC10076824A /* Pods.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = "<group>"; };
- 51FFA22A14291C240076824A /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = file; name = libPods.a; path = "Pods/build/Release-iphoneos/libPods.a"; sourceTree = "<group>"; };
- F8D25D171396A9D300CF3BD6 /* placeholder-stamp.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placeholder-stamp.png"; path = "Images/placeholder-stamp.png"; sourceTree = SOURCE_ROOT; };
- F8D25D181396A9D300CF3BD6 /* placeholder-stamp@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placeholder-stamp@2x.png"; path = "Images/placeholder-stamp@2x.png"; sourceTree = SOURCE_ROOT; };
- F8D25D1B1396A9DE00CF3BD6 /* AFGowallaAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFGowallaAPIClient.h; path = Classes/AFGowallaAPIClient.h; sourceTree = "<group>"; };
- F8D25D1D1396A9DE00CF3BD6 /* AFGowallaAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFGowallaAPIClient.m; path = Classes/AFGowallaAPIClient.m; sourceTree = "<group>"; };
- F8DA09C71396AB690057D0CC /* NearbySpotsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NearbySpotsViewController.h; sourceTree = "<group>"; };
- F8DA09C81396AB690057D0CC /* NearbySpotsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NearbySpotsViewController.m; sourceTree = "<group>"; };
- F8DA09CA1396AB690057D0CC /* Spot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spot.h; sourceTree = "<group>"; };
- F8DA09CB1396AB690057D0CC /* Spot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Spot.m; sourceTree = "<group>"; };
- F8DA09CD1396AB690057D0CC /* SpotTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpotTableViewCell.h; sourceTree = "<group>"; };
- F8DA09CE1396AB690057D0CC /* SpotTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpotTableViewCell.m; sourceTree = "<group>"; };
- F8DA09E31396AC040057D0CC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
- F8DA09E51396AC220057D0CC /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
- F8DA09E61396AC220057D0CC /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
- F8DA09E71396AC220057D0CC /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
- F8E469601395739C00DB05C8 /* AFNetworkingExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFNetworkingExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
- F8E469641395739D00DB05C8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
- F8E469661395739D00DB05C8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- F8E469681395739D00DB05C8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- F8E4696C1395739D00DB05C8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- F8E469DE13957DD500DB05C8 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
- F8E469E013957DF100DB05C8 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
- F8E469E213957DF700DB05C8 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- F8E469E413957E0400DB05C8 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- FF2B770C140DAC4E00A8DEC2 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- F8E4695D1395739C00DB05C8 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 51FFA22B14291C240076824A /* libPods.a in Frameworks */,
- F8E469651395739D00DB05C8 /* UIKit.framework in Frameworks */,
- F8E469671395739D00DB05C8 /* Foundation.framework in Frameworks */,
- F8E469691395739D00DB05C8 /* CoreGraphics.framework in Frameworks */,
- F8E469DF13957DD500DB05C8 /* CoreLocation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- F8DA09C61396AB690057D0CC /* Controllers */ = {
- isa = PBXGroup;
- children = (
- F8DA09C71396AB690057D0CC /* NearbySpotsViewController.h */,
- F8DA09C81396AB690057D0CC /* NearbySpotsViewController.m */,
- );
- name = Controllers;
- path = Classes/Controllers;
- sourceTree = SOURCE_ROOT;
- };
- F8DA09C91396AB690057D0CC /* Models */ = {
- isa = PBXGroup;
- children = (
- F8DA09CA1396AB690057D0CC /* Spot.h */,
- F8DA09CB1396AB690057D0CC /* Spot.m */,
- );
- name = Models;
- path = Classes/Models;
- sourceTree = SOURCE_ROOT;
- };
- F8DA09CC1396AB690057D0CC /* Views */ = {
- isa = PBXGroup;
- children = (
- F8DA09CD1396AB690057D0CC /* SpotTableViewCell.h */,
- F8DA09CE1396AB690057D0CC /* SpotTableViewCell.m */,
- );
- name = Views;
- path = Classes/Views;
- sourceTree = SOURCE_ROOT;
- };
- F8E469551395739C00DB05C8 = {
- isa = PBXGroup;
- children = (
- 51FFA22A14291C240076824A /* libPods.a */,
- 51FFA22514291BC10076824A /* Pods.xcconfig */,
- F8E469B71395759C00DB05C8 /* Networking Extensions */,
- F8E4696A1395739D00DB05C8 /* Classes */,
- F8E469ED1395812A00DB05C8 /* Images */,
- F8E469631395739D00DB05C8 /* Frameworks */,
- F8E469611395739C00DB05C8 /* Products */,
- );
- sourceTree = "<group>";
- };
- F8E469611395739C00DB05C8 /* Products */ = {
- isa = PBXGroup;
- children = (
- F8E469601395739C00DB05C8 /* AFNetworkingExample.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- F8E469631395739D00DB05C8 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- F8E469E413957E0400DB05C8 /* SystemConfiguration.framework */,
- F8E469E213957DF700DB05C8 /* SystemConfiguration.framework */,
- F8E469E013957DF100DB05C8 /* Security.framework */,
- F8E469DE13957DD500DB05C8 /* CoreLocation.framework */,
- F8E469641395739D00DB05C8 /* UIKit.framework */,
- F8E469661395739D00DB05C8 /* Foundation.framework */,
- F8E469681395739D00DB05C8 /* CoreGraphics.framework */,
- FF2B770C140DAC4E00A8DEC2 /* libz.dylib */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- F8E4696A1395739D00DB05C8 /* Classes */ = {
- isa = PBXGroup;
- children = (
- F8DA09C61396AB690057D0CC /* Controllers */,
- F8DA09C91396AB690057D0CC /* Models */,
- F8DA09CC1396AB690057D0CC /* Views */,
- F8E4696B1395739D00DB05C8 /* Supporting Files */,
- );
- name = Classes;
- path = AFNetworkingExample;
- sourceTree = "<group>";
- };
- F8E4696B1395739D00DB05C8 /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- F8DA09E31396AC040057D0CC /* main.m */,
- F8DA09E61396AC220057D0CC /* Prefix.pch */,
- F8DA09E51396AC220057D0CC /* AppDelegate.h */,
- F8DA09E71396AC220057D0CC /* AppDelegate.m */,
- F8E4696C1395739D00DB05C8 /* Info.plist */,
- );
- name = "Supporting Files";
- sourceTree = "<group>";
- };
- F8E469B71395759C00DB05C8 /* Networking Extensions */ = {
- isa = PBXGroup;
- children = (
- F8D25D1B1396A9DE00CF3BD6 /* AFGowallaAPIClient.h */,
- F8D25D1D1396A9DE00CF3BD6 /* AFGowallaAPIClient.m */,
- );
- name = "Networking Extensions";
- sourceTree = "<group>";
- };
- F8E469ED1395812A00DB05C8 /* Images */ = {
- isa = PBXGroup;
- children = (
- F8D25D171396A9D300CF3BD6 /* placeholder-stamp.png */,
- F8D25D181396A9D300CF3BD6 /* placeholder-stamp@2x.png */,
- );
- name = Images;
- path = AFNetworkingExample/Images;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- F8E4695F1395739C00DB05C8 /* AFNetworkingExample */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F8E469811395739D00DB05C8 /* Build configuration list for PBXNativeTarget "AFNetworkingExample" */;
- buildPhases = (
- F8E4695C1395739C00DB05C8 /* Sources */,
- F8E4695D1395739C00DB05C8 /* Frameworks */,
- F8E4695E1395739C00DB05C8 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = AFNetworkingExample;
- productName = AFNetworkingExample;
- productReference = F8E469601395739C00DB05C8 /* AFNetworkingExample.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- F8E469571395739C00DB05C8 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0420;
- ORGANIZATIONNAME = Gowalla;
- };
- buildConfigurationList = F8E4695A1395739C00DB05C8 /* Build configuration list for PBXProject "AFNetworking Example" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = F8E469551395739C00DB05C8;
- productRefGroup = F8E469611395739C00DB05C8 /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- F8E4695F1395739C00DB05C8 /* AFNetworkingExample */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- F8E4695E1395739C00DB05C8 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F8D25D191396A9D300CF3BD6 /* placeholder-stamp.png in Resources */,
- F8D25D1A1396A9D300CF3BD6 /* placeholder-stamp@2x.png in Resources */,
- 51FFA22614291BC10076824A /* Pods.xcconfig in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- F8E4695C1395739C00DB05C8 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F8DA09D21396ABED0057D0CC /* AFGowallaAPIClient.m in Sources */,
- F8DA09D41396ABED0057D0CC /* NearbySpotsViewController.m in Sources */,
- F8DA09D51396ABED0057D0CC /* Spot.m in Sources */,
- F8DA09D61396ABED0057D0CC /* SpotTableViewCell.m in Sources */,
- F8DA09E41396AC040057D0CC /* main.m in Sources */,
- F8DA09E81396AC220057D0CC /* AppDelegate.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- F8E4697F1395739D00DB05C8 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = com.apple.compilers.llvmgcc42;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
- SDKROOT = iphoneos;
- };
- name = Debug;
- };
- F8E469801395739D00DB05C8 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_VERSION = com.apple.compilers.llvmgcc42;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
- OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
- SDKROOT = iphoneos;
- };
- name = Release;
- };
- F8E469821395739D00DB05C8 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 51FFA22514291BC10076824A /* Pods.xcconfig */;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Prefix.pch;
- INFOPLIST_FILE = Info.plist;
- PRODUCT_NAME = "$(TARGET_NAME)";
- WRAPPER_EXTENSION = app;
- };
- name = Debug;
- };
- F8E469831395739D00DB05C8 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 51FFA22514291BC10076824A /* Pods.xcconfig */;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Prefix.pch;
- INFOPLIST_FILE = Info.plist;
- PRODUCT_NAME = "$(TARGET_NAME)";
- VALIDATE_PRODUCT = YES;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- F8E4695A1395739C00DB05C8 /* Build configuration list for PBXProject "AFNetworking Example" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F8E4697F1395739D00DB05C8 /* Debug */,
- F8E469801395739D00DB05C8 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F8E469811395739D00DB05C8 /* Build configuration list for PBXNativeTarget "AFNetworkingExample" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F8E469821395739D00DB05C8 /* Debug */,
- F8E469831395739D00DB05C8 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = F8E469571395739C00DB05C8 /* Project object */;
-}
View
7 ...rking Example/AFNetworking Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:AFNetworking Example.xcodeproj">
- </FileRef>
-</Workspace>
View
10 examples/AFNetworking Example/AFNetworking Example.xcworkspace/contents.xcworkspacedata
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "group:Pods/Pods.xcodeproj">
- </FileRef>
- <FileRef
- location = "group:AFNetworking Example.xcodeproj">
- </FileRef>
-</Workspace>
View
32 examples/AFNetworking Example/AppDelegate.h
@@ -1,32 +0,0 @@
-// AFNetworkingExampleAppDelegate.h
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-@interface AppDelegate : NSObject <UIApplicationDelegate> {
-
-}
-
-@property (nonatomic, retain) UIWindow *window;
-@property (nonatomic, retain) UINavigationController *navigationController;
-
-@end
View
50 examples/AFNetworking Example/AppDelegate.m
@@ -1,50 +0,0 @@
-// AFNetworkingExampleAppDelegate.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "AppDelegate.h"
-#import "NearbySpotsViewController.h"
-
-@implementation AppDelegate
-@synthesize window = _window;
-@synthesize navigationController = _navigationController;
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- NSURLCache *URLCache = [[[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil] autorelease];
- [NSURLCache setSharedURLCache:URLCache];
-
- UITableViewController *viewController = [[[NearbySpotsViewController alloc] init] autorelease];
- self.navigationController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];
-
- self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- self.window.backgroundColor = [UIColor whiteColor];
- self.window.rootViewController = self.navigationController;
- [self.window makeKeyAndVisible];
- return YES;
-}
-
-- (void)dealloc {
- [_window release];
- [_navigationController release];
- [super dealloc];
-}
-
-@end
View
31 examples/AFNetworking Example/Classes/AFGowallaAPIClient.h
@@ -1,31 +0,0 @@
-// AFGowallaAPI.h
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-#import "AFNetworking/AFRestClient.h"
-
-extern NSString * const kAFGowallaClientID;
-extern NSString * const kAFGowallaBaseURLString;
-
-@interface AFGowallaAPIClient : AFRestClient
-+ (id)sharedClient;
-@end
View
61 examples/AFNetworking Example/Classes/AFGowallaAPIClient.m
@@ -1,61 +0,0 @@
-// AFGowallaAPI.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "AFGowallaAPIClient.h"
-
-static AFGowallaAPIClient *_sharedClient = nil;
-
-// Replace this with your own API Key, available at http://api.gowalla.com/api/keys/
-NSString * const kAFGowallaClientID = @"e7ccb7d3d2414eb2af4663fc91eb2793";
-
-NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/";
-
-@implementation AFGowallaAPIClient
-
-+ (id)sharedClient {
- static dispatch_once_t oncePredicate;
- dispatch_once(&oncePredicate, ^{
- _sharedClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:kAFGowallaBaseURLString]];
- });
-
- return _sharedClient;
-}
-
-- (id)initWithBaseURL:(NSURL *)url {
- self = [super initWithBaseURL:url];
- if (!self) {
- return nil;
- }
-
- // X-Gowalla-API-Key HTTP Header; see http://api.gowalla.com/api/docs
- [self setDefaultHeader:@"X-Gowalla-API-Key" value:kAFGowallaClientID];
-
- // X-Gowalla-API-Version HTTP Header; see http://api.gowalla.com/api/docs
- [self setDefaultHeader:@"X-Gowalla-API-Version" value:@"1"];
-
- // X-UDID HTTP Header
- [self setDefaultHeader:@"X-UDID" value:[[UIDevice currentDevice] uniqueIdentifier]];
-
- return self;
-}
-
-@end
View
32 examples/AFNetworking Example/Classes/Controllers/NearbySpotsViewController.h
@@ -1,32 +0,0 @@
-// NearbySpotsViewController.h
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-#import <CoreLocation/CoreLocation.h>
-
-@interface NearbySpotsViewController : UITableViewController <CLLocationManagerDelegate> {
- NSArray *_nearbySpots;
- CLLocationManager *_locationManager;
- UIActivityIndicatorView *_activityIndicatorView;
-}
-
-@end
View
187 examples/AFNetworking Example/Classes/Controllers/NearbySpotsViewController.m
@@ -1,187 +0,0 @@
-// NearbySpotsViewController.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "NearbySpotsViewController.h"
-
-#import "Spot.h"
-
-#import "SpotTableViewCell.h"
-
-#import "FormatterKit/TTTLocationFormatter.h"
-#import "AFNetworking/AFImageCache.h"
-#import "AFNetworking/UIImageView+AFNetworking.h"
-
-@interface NearbySpotsViewController ()
-@property (readwrite, nonatomic, retain) NSArray *nearbySpots;
-@property (readwrite, nonatomic, retain) CLLocationManager *locationManager;
-@property (readwrite, nonatomic, retain) UIActivityIndicatorView *activityIndicatorView;
-
-- (void)loadSpotsForLocation:(CLLocation *)location;
-- (void)refresh:(id)sender;
-@end
-
-@implementation NearbySpotsViewController
-@synthesize nearbySpots = _spots;
-@synthesize locationManager = _locationManager;
-@synthesize activityIndicatorView = _activityIndicatorView;
-
-- (id)init {
- self = [super init];
- if (!self) {
- return nil;
- }
-
- self.nearbySpots = [NSArray array];
-
- self.locationManager = [[[CLLocationManager alloc] init] autorelease];
- self.locationManager.delegate = self;
- self.locationManager.distanceFilter = 80.0;
-
- return self;
-}
-
-- (void)dealloc {
- [_spots release];
- [_locationManager release];
- [_activityIndicatorView release];
- [super dealloc];
-}
-
-- (void)loadSpotsForLocation:(CLLocation *)location {
- [self.activityIndicatorView startAnimating];
- self.navigationItem.rightBarButtonItem.enabled = NO;
-
- [Spot spotsWithURLString:@"/spots/advanced_search" near:location parameters:[NSDictionary dictionaryWithObject:@"128" forKey:@"per_page"] block:^(NSArray *records) {
- self.nearbySpots = [records sortedArrayUsingComparator:^ NSComparisonResult(id obj1, id obj2) {
- CLLocationDistance d1 = [[(Spot *)obj1 location] distanceFromLocation:location];
- CLLocationDistance d2 = [[(Spot *)obj2 location] distanceFromLocation:location];
-
- if (d1 < d2) {
- return NSOrderedAscending;
- } else if (d1 > d2) {
- return NSOrderedDescending;
- } else {
- return NSOrderedSame;
- }
- }];
-
- [self.tableView reloadData];
-
- [self.activityIndicatorView stopAnimating];
- self.navigationItem.rightBarButtonItem.enabled = YES;
- }];
-}
-
-#pragma mark - UIViewController
-
-- (void)viewDidLoad {
- [super viewDidLoad];
-
- self.title = NSLocalizedString(@"AFNetworking", nil);
-
- self.activityIndicatorView = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
- self.activityIndicatorView.hidesWhenStopped = YES;
- self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:self.activityIndicatorView] autorelease];
-
- self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh:)] autorelease];
- self.navigationItem.rightBarButtonItem.enabled = NO;
-
- [self.navigationController.navigationBar setTintColor:[UIColor darkGrayColor]];
-
- self.tableView.rowHeight = 70.0f;
-
- [self.locationManager startUpdatingLocation];
-}
-
-- (void)viewDidUnload {
- [super viewDidUnload];
- [self.locationManager stopUpdatingLocation];
-}
-
-#pragma mark - Actions
-
-- (void)refresh:(id)sender {
- self.nearbySpots = [NSArray array];
- [self.tableView reloadData];
- [[NSURLCache sharedURLCache] removeAllCachedResponses];
- [[AFImageCache sharedImageCache] removeAllObjects];
-
- if (self.locationManager.location) {
- [self loadSpotsForLocation:self.locationManager.location];
- }
-}
-
-#pragma mark - CLLocationManagerDelegate
-
-- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
- [self loadSpotsForLocation:newLocation];
-}
-
-#pragma mark - UITableViewDataSource
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return [self.nearbySpots count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"Cell";
-
- SpotTableViewCell *cell = (SpotTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[SpotTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
- }
-
- static TTTLocationFormatter *_locationFormatter = nil;
- if (!_locationFormatter) {
- _locationFormatter = [[TTTLocationFormatter alloc] init];
- [_locationFormatter setUnitSystem:TTTImperialSystem];
- }
-
- Spot *spot = [self.nearbySpots objectAtIndex:indexPath.row];
- cell.textLabel.text = spot.name;
- if (self.locationManager.location) {
- cell.detailTextLabel.text = [_locationFormatter stringFromDistanceAndBearingFromLocation:self.locationManager.location toLocation:spot.location];
- }
- [cell.imageView setImageWithURL:[NSURL URLWithString:spot.imageURLString] placeholderImage:[UIImage imageNamed:@"placeholder-stamp.png"]];
-
- return cell;
-}
-
-#pragma mark - UITableViewDelegate
-
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
- if ([self tableView:tableView numberOfRowsInSection:section] > 0) {
- return NSLocalizedString(@"Nearby Spots", nil);
- }
-
- return nil;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
-}
-
-@end
View
45 examples/AFNetworking Example/Classes/Models/Spot.h
@@ -1,45 +0,0 @@
-// Spot.h
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-#import <CoreLocation/CoreLocation.h>
-
-typedef void (^AFRecordsBlock)(NSArray *records);
-
-@interface Spot : NSObject {
-@private
- NSString *_name;
- NSString *_imageURLString;
- NSNumber *_latitude;
- NSNumber *_longitude;
-}
-
-@property (nonatomic, retain) NSString *name;
-@property (nonatomic, retain) NSString *imageURLString;
-@property (nonatomic, retain) NSNumber *latitude;
-@property (nonatomic, retain) NSNumber *longitude;
-@property (readonly) CLLocation *location;
-
-- (id)initWithAttributes:(NSDictionary *)attributes;
-+ (void)spotsWithURLString:(NSString *)urlString near:(CLLocation *)location parameters:(NSDictionary *)parameters block:(AFRecordsBlock)block;
-
-@end
View
84 examples/AFNetworking Example/Classes/Models/Spot.m
@@ -1,84 +0,0 @@
-// Spot.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "Spot.h"
-
-#import "AFGowallaAPIClient.h"
-
-@implementation Spot
-@synthesize name = _name;
-@synthesize imageURLString = _imageURLString;
-@synthesize latitude = _latitude;
-@synthesize longitude = _longitude;
-@dynamic location;
-
-- (id)initWithAttributes:(NSDictionary *)attributes {
- self = [super init];
- if (!self) {
- return nil;
- }
-
- self.name = [attributes valueForKeyPath:@"name"];
- self.imageURLString = [attributes valueForKeyPath:@"image_url"];
- self.latitude = [attributes valueForKeyPath:@"lat"];
- self.longitude = [attributes valueForKeyPath:@"lng"];
-
- return self;
-}
-
-- (void)dealloc {
- [_name release];
- [_imageURLString release];
- [_latitude release];
- [_longitude release];
- [super dealloc];
-}
-
-- (CLLocation *)location {
- return [[[CLLocation alloc] initWithLatitude:[self.latitude doubleValue] longitude:[self.longitude doubleValue]] autorelease];
-}
-
-+ (void)spotsWithURLString:(NSString *)urlString near:(CLLocation *)location parameters:(NSDictionary *)parameters block:(AFRecordsBlock)block {
- NSDictionary *mutableParameters = [NSMutableDictionary dictionaryWithDictionary:parameters];
- if (location) {
- [mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.latitude] forKey:@"lat"];
- [mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.longitude] forKey:@"lng"];
- }
-
- [[AFGowallaAPIClient sharedClient] getPath:urlString parameters:mutableParameters success:^(id response) {
- NSMutableArray *mutableRecords = [NSMutableArray array];
- for (NSDictionary *attributes in [response valueForKeyPath:@"spots"]) {
- Spot *spot = [[[Spot alloc] initWithAttributes:attributes] autorelease];
- [mutableRecords addObject:spot];
- }
-
- if (block) {
- block([NSArray arrayWithArray:mutableRecords]);
- }
- } failure:^(NSError *error) {
- if (block) {
- block([NSArray array]);
- }
- }];
-}
-
-@end
View
27 examples/AFNetworking Example/Classes/Views/SpotTableViewCell.h
@@ -1,27 +0,0 @@
-// SpotTableViewCell.h
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-@interface SpotTableViewCell : UITableViewCell
-
-@end
View
66 examples/AFNetworking Example/Classes/Views/SpotTableViewCell.m
@@ -1,66 +0,0 @@
-// SpotTableViewCell.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "SpotTableViewCell.h"
-
-@implementation SpotTableViewCell
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (!self) {
- return nil;
- }
-
- self.textLabel.textColor = [UIColor darkGrayColor];
- self.textLabel.numberOfLines = 2;
-
- self.detailTextLabel.textColor = [UIColor grayColor];
-
- self.selectionStyle = UITableViewCellSelectionStyleGray;
-
- return self;
-}
-
-#pragma mark - UIView
-
-- (void)layoutSubviews {
- [super layoutSubviews];
-
- CGRect imageViewFrame = self.imageView.frame;
- CGRect textLabelFrame = self.textLabel.frame;
- CGRect detailTextLabelFrame = self.detailTextLabel.frame;
-
- imageViewFrame.origin = CGPointMake(10.0f, 10.0f);
- imageViewFrame.size = CGSizeMake(50.0f, 50.0f);
-
- textLabelFrame.origin.x = imageViewFrame.size.width + 25.0f;
- detailTextLabelFrame.origin.x = textLabelFrame.origin.x;
-
- textLabelFrame.size.width = 240.0f;
- detailTextLabelFrame.size.width = textLabelFrame.size.width;
-
- self.textLabel.frame = textLabelFrame;
- self.detailTextLabel.frame = detailTextLabelFrame;
- self.imageView.frame = imageViewFrame;
-}
-
-@end
View
BIN examples/AFNetworking Example/Images/placeholder-stamp.png
Deleted file not rendered
View
BIN examples/AFNetworking Example/Images/placeholder-stamp@2x.png
Deleted file not rendered
View
34 examples/AFNetworking Example/Info.plist
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleDisplayName</key>
- <string>AFNetworking</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.alamofire.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>0.1.0</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- </array>
-</dict>
-</plist>
View
11 examples/AFNetworking Example/LICENSE
@@ -1,11 +0,0 @@
-License
-
-AFNetworking is licensed under the MIT License:
-
-Copyright (c) 2011 Gowalla (http://gowalla.com/)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
4 examples/AFNetworking Example/Podfile
@@ -1,4 +0,0 @@
-platform :ios
-
-dependency 'AFNetworking'
-dependency 'FormatterKit'
View
10 examples/AFNetworking Example/Prefix.pch
@@ -1,10 +0,0 @@
-#import <Availability.h>
-
-#ifndef __IPHONE_3_0
-#warning "This project uses features only available in iPhone SDK 3.0 and later."
-#endif
-
-#ifdef __OBJC__
- #import <UIKit/UIKit.h>
- #import <Foundation/Foundation.h>
-#endif
View
31 examples/AFNetworking Example/README.md
@@ -1,31 +0,0 @@
-This is the example that comes with [AFNetworking][url] updated to use CocoaPods.
-
-To build it, you'll first have to install the app's dependencies. From the
-example directory, in the terminal, run the following command:
-
- $ pod install
-
-This has generated the contents of the `Pods` directory, which contains an Xcode
-project that is included in the `AFNetworking Example.xcworkspace` and which
-will make sure the dependencies are build before the app is build.
-
-Go ahead, open the workspace and build it.
-
-
-### These are the steps I had to perform to update the project:
-
-1. remove Vendor, delete files
-2. remove libz from build phases => libraries
-3. remove ‘always search user header paths’ setting (normally not needed)
-4. create Podfile with:
-
- dependency 'AFNetworking'
- dependency 'JSONKit'
- dependency 'FormatterKit'
-
-5. $ pod install
-6. Follow steps from the [‘In Xcode’ section][more].
-
-
-[url]: https://github.com/gowalla/AFNetworking/tree/master/Example
-[more]: https://github.com/alloy/cocoapods/wiki/Creating-a-project-that-uses-CocoaPods
View
30 examples/AFNetworking Example/main.m
@@ -1,30 +0,0 @@
-// main.m
-//
-// Copyright (c) 2011 Gowalla (http://gowalla.com/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <UIKit/UIKit.h>
-
-int main(int argc, char *argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"AppDelegate");
- [pool release];
- return retVal;
-}
View
17 examples/AFNetworking Mac Example/Podfile
@@ -1,19 +1,4 @@
platform :osx
dependency 'FormatterKit'
-
-dependency do |s|
- s.name = 'AFNetworking'
- s.version = '0.7.0'
- s.summary = 'A delightful iOS networking library with NSOperations and block-based callbacks'
- s.homepage = 'https://github.com/gowalla/AFNetworking'
- s.author = { 'Gowalla' => 'live@gowalla.com' }
- s.source = { :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0' }
-
- s.source_files = 'AFNetworking'
- s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
-
- s.library = 'z'
- s.dependency 'JSONKit'
-end
-
+dependency 'AFNetworking', '~> 0.7.0'
View
1 ...es/AFNetworking iOS Example/AFNetworking iOS Example.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Workspace version="1.0"><FileRef location="group:Pods/Pods.xcodeproj"></FileRef><FileRef location="group:AFNetworking iOS Example.xcodeproj"></FileRef></Workspace>
View
16 examples/AFNetworking iOS Example/Podfile
@@ -1,18 +1,4 @@
platform :ios
dependency 'FormatterKit'
-
-dependency do |s|
- s.name = 'AFNetworking'
- s.version = '0.7.0'
- s.summary = 'A delightful iOS networking library with NSOperations and block-based callbacks'
- s.homepage = 'https://github.com/gowalla/AFNetworking'
- s.author = { 'Gowalla' => 'live@gowalla.com' }
- s.source = { :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0' }
-
- s.source_files = 'AFNetworking'
- s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
-
- s.library = 'z'
- s.dependency 'JSONKit'
-end
+dependency 'AFNetworking', '~> 0.7.0'
View
4 lib/cocoapods/xcode/project.rb
@@ -349,7 +349,7 @@ class PBXCopyFilesBuildPhase < PBXBuildPhase
def self.new_pod_dir(project, pod_name, path)
new(project, nil, {
- "dstPath" => "$(PUBLIC_HEADERS_FOLDER_PATH)/#{path}",
+ "dstPath" => "$(PRODUCT_NAME)/#{path}",
"name" => "Copy #{pod_name} Public Headers",
})
end
@@ -388,7 +388,7 @@ def self.new_static_library(project, productName)
buildPhase.files << framework.buildFiles.new
end
- target.buildPhases.add(PBXCopyFilesBuildPhase, 'dstPath' => '$(PUBLIC_HEADERS_FOLDER_PATH)')
+ target.buildPhases.add(PBXCopyFilesBuildPhase, 'dstPath' => '$(PRODUCT_NAME)')
target
end

0 comments on commit 159dd1f

Please sign in to comment.
Something went wrong with that request. Please try again.