Static properties

extern NSString *const kStartKey;
extern NSString *const kEndKey;


NSString *const kStartKey = @"start";
NSString *const kEndKey = @"end";

Cmd + Shift + Right Click to select subviews in storyboard
Alt + = to re-layout elements autolayout
Shift + Right Click Select subviews in storyboard

Simple initializer

- (instancetype)init
    self = [super init];
    if (self) {
        // do init work here, e.g. _myIvar = someParam;
    return self;

@interface Foo : NSObject <SPTAppRemoteContentAPI>

- (instancetype)initWithBar:(Bar *)client NS_DESIGNATED_INITIALIZER;

#pragma mark Unavailable Initializers
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;




@protocol PlayerStateDelegate <NSObject>
- (void)playerStateDidChange:(id<PlayerState>)playerState;

@property (nonatomic, weak) id<PlayerStateDelegate> delegate;


Image compression
Network latency

Design sizes


NSLog(@"%s #%d: Error fetching access token with error:%@", __FILE__, __LINE__, error);
NSLog(@"%@", @(__FUNCTION__));

Speed up build by putting this is ~/.bashrc

export USE_CCACHE=1

How to see who calls what method

Screen Shot 2017-07-12 at 2.47.31 PM.png

Links that help

5 Comments (+add yours?)

  1. Jody
    Oct 10, 2012 @ 23:26:44

    Something that always bothered me about Apple’s APIs, or at least examples of their usage, is the messyness of implementation. Is it lack of OO design?

    i.e. The table view delegate from above implements the cellForRowAtIndex, and this one method is responsible for dequeueing or creating a cell (factory) as well as populating it (builder/strategy?)


    • JR
      Oct 11, 2012 @ 19:12:48

      I’ve heard arguments both ways.

      Some people I know love the API. They think it’s one of the most mature, stable platforms they’ve ever worked on.

      Others have thoughts similar to you. They think certain abstractions leak responsibility and are messy from an OO point-of-view.

      I personally like the API. But I would be the first to agree it isn’t perfect (the ALAssetLibrary I find particularly cumbersom).

      Thanks for the comment Jody.


  2. rob v
    Jan 03, 2013 @ 02:24:51

    some of your examples would be great to add into the code snippets library in the XCode inspector panel as user snippet, even if temporarily, until they become familiar. thanks for posting


  3. chandresh maurya
    Jun 11, 2014 @ 17:24:17

    how to use nsmutablearray to add multiple images in a single use of cell


  4. chandresh maurya
    Jun 11, 2014 @ 17:25:26

    how to use Ns mutable array to add multiple images in a single row of cell for ios


Leave a Reply to chandresh maurya Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: