Error:

Class declaration

@interface XYZObject : NSObject {
    int instanceVar1;
    NSString *instanceVar2;
}

@end

Class definition

#import "XYZObject.h"

@implementation XYZObject
// actual code
@end

Object property definition

@interface XYZObject : NSObject
// read: obj.name
// write: obj.name = @"Name"
@property NSString *name;
@end

Object read-only property definition

@interface XYZObject : NSObject
// read: obj.name
// write: obj.name = @"Name"
@property (readonly) NSString *name;
@end

Class method declaration

@interface DeepThought : NSObject
// Usage: 
// NSString *answer = [DeepThought answerToQuestion:@"Why?"];
+ (NSString*)answerToQuestion:(NSString *)question;
@end

Class method definition

@implementation DeepThought
+ (NSString*)answerToQuestion:(NSString *)question {
    return @"42";
}
@end

Instance method declaration

@interface DeepThought : NSObject
// Usage: 
// DeepThough *dt = [[DeepThough alloc] init];
// NSString *answer = [dt answerToQuestion:@"Why?"];
- (NSString*)answerToQuestion:(NSString *)question;
@end

Instance method definition

@implementation DeepThought
- (NSString*)answerToQuestion:(NSString *)question {
    return @"42";
}
@end

Call method of superclass

[super someObscureMethod];

Create new object

// Effectively the same as [[XYZObject alloc] init]
XYZObject *obj = [XYZObject new];

Change getter name for property

@interface XYZObject : NSObject
// read: [obj isOpened]
// write: [obj setOpened:YES]
@property (getter = isOpened) BOOL opened;
@end

Change setter name for property

@interface XYZObject : NSObject
// read: [obj opened]
// write: [obj mySetOpened:YES]
@property (setter = mySetOpened) BOOL opened;
@end

Declare weak variable

NSObject * __weak obj;

Declare category

@interface NSObject (MyCategory)
// no @property here
- (void)myAdditionToNSObject;
@end

Define category

@implementation NSObject (MyCategory)
- (void)myAdditionToNSObject {
    // do some obscure stuff
}
@end

Declare class extension

@interface MyClass () {
    NSInteger _privateCounter;
}
@property NSString  *privateProperty;
@end

Declare protocol

@protocol MyClassDelegate
// requried method
- (id)handleData:(id)data;
@end

Indicate propertie's conformance to protocol

@interface MyClass : NSObject
@property id<MyClassDelegate, OneMoreProtocol> delegate;
@end

Indicate class'es conformance to protocol

@interface MyClass : NSObject<MyProtocol, OneMoreProtocol>
@end

Declare optional methods of protocol

@protocol MyClassDelegate
// this one is mandatory
- (id)handleData:(id)data;
@optional
- (id)optionalMethod;
@required
- (void)andOneMoreMandatoryMethod;
@end

Declare protocol with inheritance

@protocol MyProtocol <AnotherProtocol>
@end

Declare block variable

//  filterPredicate is variable name
BOOL (^filterPredicate)(id);

Declare block variable and initialize it unsing literal

BOOL (^filterPredicate)(id) = ^(id obj) {
    // filter nameless objects
    if ([[obj name] length] == 0)
        return YES;
    else
        return NO;
};

typedef block signature

typedef BOOL (^XYZFilterPredicate)(id);
// …
XYZFilterPredicate predicate = ^(id obj) {
    // filter nameless objects
    if ([[obj name] length] == 0)
        return YES;
    else
        return NO;
};

Define block property

@property (copy) BOOL (^filterPredicate)(id);

Handle exception

@try {
    // do something reckless here
}
@catch (NSException *exception) {
    // deal with exception
}
@finally {
    // executed whether or not exception occurred
}

Throw exception

NSException *e = [NSException
        exceptionWithName:@"NoMilkException"
        reason:@"No milk in the fridge"
        userInfo:nil];
// or [e raise];
@throw e;

Number literal

// float
NSNumber *pi = @3.14f;

String literal

NSString *piStr = @"3.14";

Array literal

NSArray *array = @[objOne, objTwo, objThree];

Dictionary literal

NSDictionary *dict = @{
    @"key1" : @"value1",
    @"key2" : @3.14f,
    @"key3" : @[@"One", @"Two"]
};