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
@interface Octopus : NSObject | |
+ (instancetype)octopus; | |
- (instancetype)init; | |
@property (nonatomic, assign) int legs; | |
@end |
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
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { | |
NotificationCell* cell = [tableView dequeueReusableCellWithIdentifier:NotificationCell.defaultReuseIdentifier forIndexPath:indexPath]; | |
cell.notification = self.notifications[indexPath.row]; | |
return cell; | |
} |
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
// | |
// UIPCenteredScrollView.m | |
// Plus | |
// | |
// Created by Maximilian Christ on 5/30/12. | |
// Copyright (c) 2012 mczonk.de. All rights reserved. | |
// | |
#import "UIPCenteredScrollView.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
- (void)myMethod { | |
NSError* error = [NSError errorWithDomain:@"myDomain" code:42 userInfo:@{ @"Foo": @"Bar" }]; | |
NSString* file = [NSBundle.mainBundle pathForResource:@"Info" ofType:@"plist"]; | |
NSData* data = [NSData dataWithContentsOfFile:file options:0 error:&error]; | |
// safe | |
if(data == nil) { | |
// only access error if data was 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
#import <Foundation/Foundation.h> | |
@interface MyObject : NSObject | |
- (id)initWithName:(NSString*)name; | |
@property (nonatomic, retain) NSString* name; | |
@end |
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
#import <Foundation/Foundation.h> | |
@interface MyObject : NSObject | |
- (id)initWithName:(NSString*)name; | |
@property (nonatomic, retain) NSString* name; | |
@end |
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 MyEnum { | |
MyEnum1, | |
MyEnum2, | |
MyEnum3, | |
} MyEnum; | |
static int function1(MyEnum e) { | |
switch(e) { // warning: Enumeration value 'MyEnum3' not handled in switch | |
case MyEnum1: | |
return 1; |
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
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_block_t block = ^{ | |
int a = 5; | |
NSLog(@"%p = %d", &a, a); |
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)foo | |
{ | |
__weak __typeof__(self) weakSelf = self; | |
dispatch_async(queue, ^{ | |
__typeof__(self) self = weakSelf; | |
[self bar]; | |
}); | |
} |
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
@implementation IrisSegue | |
- (void)perform | |
{ | |
CATransition *shutterAnimation = [CATransition animation]; | |
[shutterAnimation setDelegate:self]; | |
[shutterAnimation setDuration:0.5]; | |
shutterAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
[shutterAnimation setType:@"cameraIris"]; |
OlderNewer