Permalink
Browse files

Stashing working implementation

  • Loading branch information...
1 parent d1e993f commit eaa9059cd20ded46190dcda939882c02611f5333 @mattt mattt committed Jun 19, 2012
Showing with 5,355 additions and 4,916 deletions.
  1. +2 −2 AFNetworking.xcworkspace/contents.xcworkspacedata
  2. +373 −0 Example/AFNetworking Mac Example.xcodeproj/project.pbxproj
  3. +12 −12 {iOS Example → Example}/AFNetworking iOS Example.xcodeproj/project.pbxproj
  4. +17 −0 {iOS Example → Example}/AppDelegate.h
  5. +37 −15 {iOS Example → Example}/AppDelegate.m
  6. 0 {iOS Example → Example}/Classes/AFTwitterAPIClient.h
  7. 0 {iOS Example → Example}/Classes/AFTwitterAPIClient.m
  8. 0 {iOS Example → Example}/Classes/Controllers/PublicTimelineViewController.h
  9. 0 {iOS Example → Example}/Classes/Controllers/PublicTimelineViewController.m
  10. 0 {iOS Example → Example}/Classes/Models/Tweet.h
  11. +6 −5 {iOS Example → Example}/Classes/Models/Tweet.m
  12. 0 {iOS Example → Example}/Classes/Models/User.h
  13. 0 {iOS Example → Example}/Classes/Models/User.m
  14. 0 {iOS Example → Example}/Classes/Views/TweetTableViewCell.h
  15. 0 {iOS Example → Example}/Classes/Views/TweetTableViewCell.m
  16. BIN {iOS Example → Example}/Default.png
  17. BIN {iOS Example → Example}/Default@2x.png
  18. BIN {iOS Example → Example}/Icon.png
  19. BIN {iOS Example → Example}/Icon@2x.png
  20. BIN {iOS Example → Example}/Images/profile-image-placeholder.png
  21. BIN {iOS Example → Example}/Images/profile-image-placeholder@2x.png
  22. +1 −3 Mac Example/Info.plist → Example/Mac-Info.plist
  23. +279 −137 {Mac Example/en.lproj → Example}/MainMenu.xib
  24. +17 −0 Example/Prefix.pch
  25. +4,587 −0 Example/en.lproj/MainMenu.xib
  26. 0 iOS Example/Info.plist → Example/iOS-Info.plist
  27. +24 −0 Example/main.m
  28. +0 −420 Mac Example/AFNetworking Mac Example.xcodeproj/project.pbxproj
  29. +0 −75 ...ng Mac Example.xcodeproj/xcuserdata/mattt.xcuserdatad/xcschemes/AFNetworking Mac Example.xcscheme
  30. +0 −22 ...FNetworking Mac Example.xcodeproj/xcuserdata/mattt.xcuserdatad/xcschemes/xcschememanagement.plist
  31. +0 −32 Mac Example/AppDelegate.h
  32. +0 −33 Mac Example/AppDelegate.m
  33. +0 −31 Mac Example/Classes/AFGowallaAPIClient.h
  34. +0 −64 Mac Example/Classes/AFGowallaAPIClient.m
  35. +0 −30 Mac Example/Classes/Controllers/NearbySpotsController.h
  36. +0 −83 Mac Example/Classes/Controllers/NearbySpotsController.m
  37. +0 −43 Mac Example/Classes/Models/Spot.h
  38. +0 −78 Mac Example/Classes/Models/Spot.m
  39. BIN Mac Example/Images/placeholder-stamp.png
  40. +0 −7 Mac Example/Prefix.pch
  41. +0 −251 Mac Example/Vendor/JSONKit/JSONKit.h
  42. +0 −3,011 Mac Example/Vendor/JSONKit/JSONKit.m
  43. +0 −83 Mac Example/Vendor/TTT/TTTLocationFormatter.h
  44. +0 −299 Mac Example/Vendor/TTT/TTTLocationFormatter.m
  45. +0 −13 Mac Example/en.lproj/Credits.rtf
  46. +0 −29 Mac Example/main.m
  47. +0 −75 ...ng iOS Example.xcodeproj/xcuserdata/mattt.xcuserdatad/xcschemes/AFNetworking iOS Example.xcscheme
  48. +0 −22 ...FNetworking iOS Example.xcodeproj/xcuserdata/mattt.xcuserdatad/xcschemes/xcschememanagement.plist
  49. +0 −11 iOS Example/Prefix.pch
  50. +0 −30 iOS Example/main.m

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -7,10 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ F8129C7415910C37009BFE23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C7215910C37009BFE23 /* AppDelegate.m */; };
F8D0701B14310F4A00653FD3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469E213957DF700DB05C8 /* SystemConfiguration.framework */; };
F8D0701C14310F4F00653FD3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469E013957DF100DB05C8 /* Security.framework */; };
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 */; };
@@ -39,15 +39,15 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ F8129C3815910830009BFE23 /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
+ F8129C7215910C37009BFE23 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
+ F8129C7315910C37009BFE23 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
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 /* AFNetworking iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AFNetworking iOS Example.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>"; };
+ F8E4696C1395739D00DB05C8 /* iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "iOS-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; };
@@ -188,10 +188,10 @@
isa = PBXGroup;
children = (
F8DA09E31396AC040057D0CC /* main.m */,
- F8DA09E61396AC220057D0CC /* Prefix.pch */,
- F8DA09E51396AC220057D0CC /* AppDelegate.h */,
- F8DA09E71396AC220057D0CC /* AppDelegate.m */,
- F8E4696C1395739D00DB05C8 /* Info.plist */,
+ F8129C3815910830009BFE23 /* Prefix.pch */,
+ F8129C7215910C37009BFE23 /* AppDelegate.m */,
+ F8129C7315910C37009BFE23 /* AppDelegate.h */,
+ F8E4696C1395739D00DB05C8 /* iOS-Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
@@ -324,7 +324,6 @@
buildActionMask = 2147483647;
files = (
F8DA09E41396AC040057D0CC /* main.m in Sources */,
- F8DA09E81396AC220057D0CC /* AppDelegate.m in Sources */,
F8FA9491150EF8C100ED4EAD /* AFTwitterAPIClient.m in Sources */,
F8FA9494150EF97E00ED4EAD /* Tweet.m in Sources */,
F8FA9497150EF98800ED4EAD /* User.m in Sources */,
@@ -340,6 +339,7 @@
F8FA94B9150EFEC100ED4EAD /* AFXMLRequestOperation.m in Sources */,
F8FA94BA150EFEC100ED4EAD /* UIImageView+AFNetworking.m in Sources */,
F8FA94C1150F019100ED4EAD /* TweetTableViewCell.m in Sources */,
+ F8129C7415910C37009BFE23 /* AppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -391,7 +391,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_UNUSED_PARAMETER = NO;
- INFOPLIST_FILE = Info.plist;
+ INFOPLIST_FILE = "iOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
@@ -410,7 +410,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_UNUSED_PARAMETER = NO;
- INFOPLIST_FILE = Info.plist;
+ INFOPLIST_FILE = "iOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
@@ -20,6 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+#import <Availability.h>
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+
#import <UIKit/UIKit.h>
@interface AppDelegate : NSObject <UIApplicationDelegate> {
@@ -30,3 +34,16 @@
@property (nonatomic, strong) UINavigationController *navigationController;
@end
+
+#else
+
+#import <Cocoa/Cocoa.h>
+
+@interface AppDelegate : NSObject <NSApplicationDelegate>
+
+@property (assign) IBOutlet NSWindow *window;
+@property (strong) IBOutlet NSArrayController *tweetsArrayController;
+
+@end
+
+#endif
@@ -21,6 +21,9 @@
// THE SOFTWARE.
#import "AppDelegate.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+
#import "PublicTimelineViewController.h"
#import "AFNetworkActivityIndicatorManager.h"
@@ -30,22 +33,41 @@ @implementation AppDelegate
@synthesize navigationController = _navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil];
- [NSURLCache setSharedURLCache:URLCache];
-
- [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
-
- UITableViewController *viewController = [[PublicTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
- self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
- self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
-
- self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
- self.window.backgroundColor = [UIColor whiteColor];
- self.window.rootViewController = self.navigationController;
- [self.window makeKeyAndVisible];
-
- return YES;
+ NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil];
+[NSURLCache setSharedURLCache:URLCache];
+
+ [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
+
+ UITableViewController *viewController = [[PublicTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
+ self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
+ self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
+
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ self.window.backgroundColor = [UIColor whiteColor];
+ self.window.rootViewController = self.navigationController;
+ [self.window makeKeyAndVisible];
+
+ return YES;
}
+@end
+
+#else
+
+#import "Tweet.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+@synthesize tweetsArrayController = _tweetsArrayController;
+
+- (void)applicationDidFinishLaunching:(NSNotification *)notification {
+ [Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
+ self.tweetsArrayController.content = tweets;
+ NSLog(@"Tweets: %@", tweets);
+ }];
+}
@end
+
+#endif
File renamed without changes.
@@ -63,11 +63,12 @@ + (void)publicTimelineTweetsWithBlock:(void (^)(NSArray *tweets))block {
if (block) {
block([NSArray arrayWithArray:mutableTweets]);
}
- } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
- NSLog(@"Error: %@", error);
-
- [[[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil] show];
-
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+ [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK", nil), nil] show];
+#else
+ [[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:[error localizedDescription]] runModal];
+#endif
if (block) {
block(nil);
}
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
@@ -22,12 +22,10 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
- <key>LSApplicationCategoryType</key>
- <string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
- <string>Copyright © 2011 Gowalla. All rights reserved.</string>
+ <string>Copyright © 2012年 __MyCompanyName__. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Oops, something went wrong.

0 comments on commit eaa9059

Please sign in to comment.