This file contains 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 *)parseDate:(NSString *)object { | |
if ([object isKindOfClass:[NSString class]]) { | |
// See workaround for parsing RFC3339 dates: | |
// http://stackoverflow.com/questions/4330137/parsing-rfc3339-dates-with-nsdateformatter-in-ios-4-x-and-macos-x-10-6-impossib | |
NSError *error = nil; | |
NSDate *date = nil; | |
[[self dateFormatter] getObjectValue:&date forString:object range:nil error:&error]; | |
return date; | |
} |
This file contains 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
NSString *url = [NSString stringWithFormat:@"http://XXXX.s3-ap-southeast-1.amazonaws.com/%@", path]; | |
[cell.imageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil]; |
This file contains 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
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBar"] forBarMetrics:UIBarMetricsDefault]; |
This file contains 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)enableNetworkDebug { | |
[[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidStartNotification | |
object:nil | |
queue:nil | |
usingBlock:^(NSNotification *note) { | |
AFHTTPRequestOperation *op = [note object]; | |
NSLog(@"\n\nREQUEST:%x \n%@\n\n", (NSUInteger)op.request, [TTTURLRequestFormatter cURLCommandFromURLRequest:op.request]); | |
}]; | |
This file contains 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 mark DLCImagePickerControllerDelegate | |
-(void) imagePickerControllerDidCancel:(DLCImagePickerController *)picker{ | |
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; | |
[self dismissModalViewControllerAnimated:YES]; | |
} | |
- (void)uploadMediaInfo:(NSDictionary *)info { | |
UIImage *resizedImage = [[info objectForKey:@"image"] imageCroppedToFitSize:CGSizeMake(800, 800)]; | |
NSData *jpegData = UIImageJPEGRepresentation(resizedImage, 0.5); |
This file contains 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
Simons-MacBook-Air:ruby simon$ git clone https://github.com/siuying/motion-github-followers | |
Testing Environment | |
==================== | |
* OS X 10.8 | |
* Xcode 4.4 | |
* 1.6Ghz Core i5 (MBA 11", Mid 2011) | |
* 4GB memory |
NewerOlder