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 - Property Overrides | |
///----------------------------- | |
/// @name Property Overrides | |
///----------------------------- | |
- (UINavigationBar *)navigationBar { | |
if(!_navigationBar) { | |
[self willChangeValueForKey:@"navigationBar"]; | |
_navigationBar = ^ { | |
CGRect frame = CGRectMake(0.f, 0.f, self.frame.size.width, 44.f); | |
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:frame]; |
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 MyViewController : UIViewController <UIApplicationDelegate> { | |
@private | |
NSMutableArray *_applicationObservers; | |
} | |
@end |
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
# Profiling | |
################# | |
Instruments | |
# Textmate Files # | |
################## | |
*.tmproj | |
# Xcode 4 Files # | |
################# |
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
# taken from: http://bit.ly/qRA6DX | |
# | |
# Version 2.0 (updated for Xcode 4, with some fixes) | |
# Changes: | |
# - Works with xcode 4, even when running xcode 3 projects (Workarounds for apple bugs) | |
# - Faster / better: only runs lipo once, instead of once per recursion | |
# - Added some debugging statemetns that can be switched on/off by changing the DEBUG_THIS_SCRIPT variable to "true" | |
# - Fixed some typos | |
# | |
# Purpose: |
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
@protocol MyProtocol <NSObject> | |
@optional | |
- (void)myClassObject:(MyClass *)myObject didFinishWithResult:(id)result; | |
@required | |
- (void)myClassObject:(MyClass *)myObject willBeingToInitialize; | |
@end | |
@interface MyClass : NSObject <MyProtocol> | |
- (void)doSomething; |
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
NSArray *resultArray = nil; | |
CFTypeRef inTypeRef = (__bridge CFTypeRef)resultArray; | |
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &inTypeRef); |
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 <Foundation/Foundation.h> | |
@interface Person : NSObject | |
@property (nonatomic, strong) NSString *firstName; | |
@property (nonatomic, strong) NSString *lastName; | |
@property (nonatomic, assign, readonly) NSString *fullName; | |
@property (nonatomic, strong) NSNumber *age; | |
- (id)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName; | |
@end |
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 <Foundation/Foundation.h> | |
@interface Blocky : NSObject | |
@property (nonatomic, strong) void (^block)(void); | |
@end | |
@implementation Blocky | |
@end | |
int main(int argc, char *argv[]) { |
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 hsl_to_hsv(float hh, float ss, float ll, | |
float* h, float* s, float *v) | |
{ | |
*h = hh; | |
ll *= 2; | |
ss *= (ll <= 1) ? ll : 2 - ll; | |
*v = (ll + ss) / 2; | |
*s = (2 * ss) / (ll + ss); | |
} |
OlderNewer