This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef DEBUG | |
| #define DebugLog(...) NSLog(__VA_ARGS__) | |
| #else | |
| #define DebugLog(...) /* */ | |
| #endif | |
| #define TraceLog(...) NSLog(__VA_ARGS__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Charles Golvin, an analyst specializing in mobile technology at Forrester Research, said in an e- | |
| mail message that the impact of Mr. Jobs’s departure might not be felt for 1.5 to 2 years, “given | |
| that the next wave of products is far along in development and his continued presence as chairman.” | |
| He added: “I think the key question is whether the Apple team will continue to work as effectively | |
| as a collaborative without the single person to rely on for the final decision.” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // External Monitor with View Controller | |
| // add this to you App Delegate subclass | |
| // In applicationDidFinishLaunching ... | |
| if ([UIScreen screens].count > 1) { | |
| [self attachViewToExt]; | |
| } | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* example usage */ | |
| JFFollowRedirect* follower = [[JFFollowRedirect alloc] init]; | |
| [follower addObserver:self forKeyPath:@"redirectStr" options:NSKeyValueObservingOptionNew | |
| context:follower]; | |
| // follow redirect | |
| [follower getRedirectURLStr:urlToFollow]; | |
| / * header */ | |
| #import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // JFDataCache.h | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface JFDataCache : NSObject { | |
| NSMutableDictionary *cache; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // JFDataCache.m | |
| // | |
| #import "JFDataCache.h" | |
| @implementation JFDataCache | |
| -(id)init { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; | |
| { | |
| NSURL *loadURL = [ [ request URL ] retain ]; // retain the loadURL for use | |
| if (([[loadURL scheme] isEqualToString: @"http"] || | |
| [[loadURL scheme] isEqualToString: @"https"] ) && | |
| (navigationType == UIWebViewNavigationTypeLinkClicked)) // Check if the scheme is http/https. You can also use these for custom links to open parts of your application. | |
| return ![[UIApplication sharedApplication] openURL:[loadURL autorelease]]; // Auto release the loadurl because we wont get to release later. then return the opposite of openURL, so if safari cant open the url, open it in the UIWebView. | |
| [loadURL release]; | |
| return YES; // URL is not http/https and should open in UIWebView | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // AsyncImageView.h | |
| // | |
| #import <UIKit/UIKit.h> | |
| @class JFDataCache; | |
| @interface AsyncCachedImageView : UIView { | |
| //could instead be a subclass of UIImageView instead of UIView, depending on what other features you want to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // AsyncImageView.m | |
| // | |
| #import "AsyncCachedImageView.h" | |
| #import "JFDataCache.h" | |
| @implementation AsyncCachedImageView | |
| - (id)initWithFrame:(CGRect)frame { |