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
test |
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
dispatch_queue_t callerQueue = dispatch_get_current_queue(); | |
dispatch_retain(callerQueue); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
// Do the work in the other thread... | |
// Example: NSArray* items = parseJSON(data); | |
dispatch_async(callerQueue, ^{ | |
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
Just a snippet. | |
Note: Don’t push or remove view controllers with non-opaque views. The underlying view of the parent view controller is removed. | |
[CATransaction begin]; | |
CATransition *transition = [CATransition animation]; | |
transition.type = kCATransitionFade; | |
transition.duration = animated ? 0.5f : 0.0f; | |
transition.fillMode = kCAFillModeForwards; |
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
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShown:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) | |
name:UIKeyboardWillHideNotification | |
object: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
@interface UIColor (myColors) | |
+ (UIColor *)questListTableViewColor; | |
+ (UIColor *)defaultBackground; | |
+ (UIColor *)defaultBackgroundColor; | |
@end | |
@implementation UIColor (myColors) | |
+ (UIColor *)questListTableViewColor | |
{ |
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
#import <UIKit/UIKit.h> | |
@interface UITableViewCellEnterText : UITableViewCell<UITextFieldDelegate>{ | |
UITextField *textField; | |
} | |
@property (nonatomic, retain) NSMutableDictionary *Value; | |
@property (nonatomic, readonly) NSString *StringValue; | |
@property (nonatomic, retain) UITextField *textField; |
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
-(IBAction)buttonPress:(id)sender | |
{ | |
NSString *keyPath = @"anchorPoint.x"; | |
CAKeyframeAnimation *kfa = [CAKeyframeAnimation animationWithKeyPath:keyPath]; | |
[kfa setValues:[NSArray arrayWithObjects: | |
[NSNumber numberWithFloat:-.05], | |
[NSNumber numberWithFloat:.1], | |
[NSNumber numberWithFloat:-.1], | |
[NSNumber numberWithFloat:.1], | |
[NSNumber numberWithFloat:-.05], |
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
NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; | |
[numberFormatter setNumberStyle: NSNumberFormatterCurrencyStyle]; |
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
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[dateFormatter setLocale:[NSLocale currentLocale]]; | |
[dateFormatter setTimeStyle:NSDateFormatterNoStyle]; | |
[dateFormatter setDateStyle:NSDateFormatterShortStyle]; |
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
OTHER_CFLAGS = -DDEBUG=1 | |
#define MARK CMLog(@"%s", __PRETTY_FUNCTION__); | |
#define CMLog(format, ...) NSLog(@"%s:%@", __PRETTY_FUNCTION__,[NSString stringWithFormat:format, ## __VA_ARGS__]); | |
CMLog(@"My iPhone is an %@, v %@", [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion]); | |
#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate]; | |
#define END_TIMER(msg) NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]); | |
#if DEBUG==1 |