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
+ (NSDate *)dateFromISO8601String:(NSString *)iso8601 { | |
if (!iso8601) { | |
return nil; | |
} | |
const char *str = [iso8601 cStringUsingEncoding:NSUTF8StringEncoding]; | |
char newStr[24]; | |
struct tm tm; | |
size_t len = strlen(str); |
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
- (void)setActivityCount:(NSInteger)activityCount { | |
[self willChangeValueForKey:@"activityCount"]; | |
_activityCount = MAX(activityCount, 0); | |
[self didChangeValueForKey:@"activityCount"]; | |
// some more yada yada from AFNetworking | |
} |
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)automaticallyNotifiesObserversForKey:(NSString *)theKey { | |
BOOL automatic = NO; | |
if ([theKey isEqualToString:@"image"]) { | |
automatic = NO; | |
} else { | |
automatic = [super automaticallyNotifiesObserversForKey:theKey]; | |
} | |
return automatic; | |
} |
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
- (void) start { | |
Log(@"Starting %@",self); | |
[self willChangeValueForKey: @"isExecuting"]; | |
_isExecuting = YES; | |
[self didChangeValueForKey: @"isExecuting"]; | |
} | |
- (void) finish { | |
[self willChangeValueForKey: @"isExecuting"]; | |
[self willChangeValueForKey: @"isFinished"]; |
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)isNetworkActivityIndicatorVisible { | |
return _activityCount > 0; | |
} | |
- (void)incrementActivityCount { | |
[self willChangeValueForKey:@"activityCount"]; | |
OSAtomicIncrement32((int32_t*)&_activityCount); | |
[self didChangeValueForKey:@"activityCount"]; | |
} |
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
PRAGMA foreign_keys=OFF; | |
BEGIN TRANSACTION; | |
CREATE TABLE cfurl_cache_schema_version(schema_version INTEGER); | |
CREATE TABLE cfurl_cache_response(entry_ID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, version INTEGER, hash_value INTEGER, storage_policy INTEGER, request_key TEXT UNIQUE, time_stamp NOT NULL DEFAULT CURRENT_TIMESTAMP); | |
CREATE TABLE cfurl_cache_blob_data(entry_ID INTEGER PRIMARY KEY, response_object BLOB, request_object BLOB, proto_props BLOB, user_info BLOB); | |
CREATE TABLE cfurl_cache_receiver_data(entry_ID INTEGER PRIMARY KEY, receiver_data BLOB); | |
DELETE FROM sqlite_sequence; | |
CREATE INDEX request_key_index ON cfurl_cache_response(request_key); | |
CREATE INDEX time_stamp_index ON cfurl_cache_response(time_stamp); | |
CREATE INDEX proto_props_index ON cfurl_cache_blob_data(entry_ID); |
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
// changes the default implementation in AFURLConnectionOperation to NOT cache per default, unless a block is set. | |
// we assume that downloads shouln't be saved into NSURLCache (which uses a disk-cache since iOS5) | |
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection | |
willCacheResponse:(NSCachedURLResponse *)cachedResponse | |
{ | |
if (self.cacheResponse) { | |
return self.cacheResponse(connection, cachedResponse); | |
} else { | |
return nil; | |
} |
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
typedef enum { | |
YLPDFImageSizeOriginal, | |
YLPDFImageSizeThumbnail, | |
YLPDFImageSizeSmall | |
} YLPDFImageSize; | |
@class YLDocument; | |
@protocol YLCacheDelegate <NSObject> | |
- (void)didCacheDocument:(YLDocument *)document page:(NSUInteger)page size:(YLPDFImageSize)size image:(UIImage *)image; |
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
// | |
// IPInsetLabel.h | |
// Instapaper | |
// | |
// Created by Marco Arment on 7/23/11. | |
// Copyright 2011 Instapaper LLC, released to the public domain. | |
// | |
#import <UIKit/UIKit.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
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h' has been modified since the precompiled header was built |