CocoaHeads

  • Archive
  • RSS
  • Ask me anything
  • Submit
banner

Matt Gemmell - API Design

    • #apple
    • #cocoa
    • #ios
    • #osx
    • #xcode
    • #objective-c
    • #ObjC
  • 12 months ago
  • 1
  • Permalink
  • Share
    Tweet

Objective-C literals for NSDictionary, NSArray, and NSNumber

Objective-C literals: one can now create literals for NSArray, NSDictionary, and NSNumber (just like one can create literals for NSString)

NSArray Literals

Previously:

 array = [NSArray arrayWithObjects:a, b, c, nil];

Now:

array = @[ a, b, c ];

NSDictionary Literals

Previously:

dict = [NSDictionary dictionaryWithObjects:@[o1, o2, o3]

  forKeys:@[k1, k2, k3]];

Now:

dict = @{ k1 : o1, k2 : o2, k3 : o3 };

NSNumber Literals

Previously:

NSNumber *number;

number = [NSNumber numberWithChar:'X'];

number = [NSNumber numberWithInt:12345];

number = [NSNumber numberWithUnsignedLong:12345ul];

number = [NSNumber numberWithLongLong:12345ll];

number = [NSNumber numberWithFloat:123.45f];

number = [NSNumber numberWithDouble:123.45];

number = [NSNumber numberWithBool:YES];

Now:

NSNumber *number;

number = @'X';

number = @12345;

number = @12345ul;

number = @12345ll;

number = @123.45f;

number = @123.45;

number = @YES;

    • #apple
    • #objective-c
    • #ObjC
    • #xcode
    • #cocoa
    • #mountain lion
    • #10.8
    • #llvm
    • #clang
  • 1 year ago
  • 110
  • Permalink
  • Share
    Tweet

10.8: Objective-C Enhancements

Objective-C Enhancements

OS X v10.8 includes the following enhancements to Objective-C:

  • Default synthesis of accessor methods for declared properties

  • Type-safe enums

  • New Core Foundation attributes that allow you to specify custom retain semantics

  • Object literals for NSArray, NSDictionary, and NSNumber

  • Streamlined object subscripting

Important Beginning in OS X v10.8, garbage collection is deprecated.

    • #apple
    • #osx
    • #objective-c
    • #ObjC
  • 1 year ago
  • 8
  • Permalink
  • Share
    Tweet

Gestures Recognizers – Tap, Pinch/Zoom, Rotate, Swipe, Pan, Long Press

    • #apple
    • #ios
    • #cocoa
    • #objective-c
    • #ObjC
    • #xcode
  • 1 year ago
  • 4
  • Permalink
  • Share
    Tweet

Managing Memory on iOS

    • #apple
    • #cocoa
    • #objective-c
    • #ObjC
    • #xcode
  • 1 year ago
  • 6
  • Permalink
  • Share
    Tweet

retainCount is useless.

    • #Apple
    • #Cocoa
    • #Objective-C
    • #ObjC
  • 1 year ago
  • 3
  • Permalink
  • Share
    Tweet

the eero programming language

a syntactically streamlined dialect of objective-c using clang/llvm

    • #apple
    • #objective-c
    • #ObjC
    • #eero
    • #clang
    • #llvm
    • #xcode
  • 1 year ago
  • 22
  • Permalink
  • Share
    Tweet
Testing Mother Fuckers, do you do it?
Pop-upView Separately

Testing Mother Fuckers, do you do it?

    • #apple
    • #ios
    • #mac
    • #osx
    • #app
    • #appstore
    • #app store
    • #cocoa
    • #objective-c
    • #ObjC
  • 1 year ago
  • 23
  • Permalink
  • Share
    Tweet

Objective-C Is The Language

I loved C. But it always fell short for me. Objective-C fixed that.

    • #apple
    • #objective-c
    • #ObjC
    • #cocoa
    • #mac
    • #ios
    • #osx
  • 1 year ago
  • 23
  • Permalink
  • Share
    Tweet

The Complete List of Objective-C 2.0 @ Compiler Directives

geppyp:

Very nice article about the objective-c 2.0 compiler directives.

    • #apple
    • #cocoa
    • #objective-c
    • #ObjC
    • #xcode
  • 1 year ago > geppyp
  • 37
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 1 of 2
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Submit
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr