Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition) (Big Nerd Ranch Guides)

By Aaron Hillegass, Mikey Ward

Are looking to write iOS apps or laptop Mac functions? This creation to programming and the Objective-C language is your first step at the trip from anyone who makes use of apps to an individual who writes them.

in line with monstrous Nerd Ranch's renowned Objective-C Bootcamp, Objective-C Programming: the large Nerd Ranch Guide covers C, Objective-C, and the typical programming idioms that allow builders to utilize Apple applied sciences. appropriate with Xcode five, iOS 7, and OS X Mavericks (10.9), this consultant good points brief chapters and an attractive type to maintain you influenced and relocating ahead. while, it encourages you to imagine significantly as a programmer.

listed below are a number of the themes coated:

  • Using Xcode, Apple’s documentation, and different instruments
  • Programming fundamentals: variables, loops, capabilities, and so on.
  • Objects, periods, equipment, and messages
  • Pointers, addresses, and reminiscence administration with ARC
  • Properties and Key-Value Coding (KVC)
  • Class extensions
  • Categories
  • Classes from the root framework
  • Blocks
  • Delegation, target-action, and notification layout styles
  • Key-Value looking at (KVO)
  • Runtime fundamentals

Show description

Preview of Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition) (Big Nerd Ranch Guides) PDF

Best Programming books

Joe Celko's SQL for Smarties: Advanced SQL Programming Third Edition (The Morgan Kaufmann Series in Data Management Systems)

SQL for Smarties used to be hailed because the first ebook dedicated explicitly to the complex recommendations had to remodel an skilled SQL programmer into knowledgeable. Now, 10 years later and within the 3rd version, this vintage nonetheless reigns perfect because the ebook written by way of an SQL grasp that teaches destiny SQL masters.

Designing Audio Effect Plug-Ins in C++: With Digital Audio Signal Processing Theory

Not only one other theory-heavy electronic sign processing publication, nor one other boring build-a-generic-database programming ebook, Designing Audio influence Plug-Ins in C++ can provide every little thing you every thing you must recognize to do exactly that, together with absolutely labored, downloadable code for dozens audio influence plug-ins and virtually offered algorithms.

Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)

“Every C++ specialist wishes a replica of potent C++. it really is an absolute must-read for somebody considering doing critical C++ improvement. If you’ve by no means learn potent C++ and also you imagine you recognize every little thing approximately C++, re-examine. ”— Steve Schirripa, software program Engineer, Google “C++ and the C++ group have grown up within the final fifteen years, and the 3rd variation of potent C++ displays this.

Cocoa Design Patterns

“Next time a few child exhibits up at my door inquiring for a code evaluation, this can be the publication that i'm going to throw at him. ”   –Aaron Hillegass, founding father of significant Nerd Ranch, Inc. , and writer of Cocoa Programming for Mac OS X   Unlocking the secrets and techniques of Cocoa and Its Object-Oriented Frameworks   Mac and iPhone builders are frequently crushed by way of the breadth and class of the Cocoa frameworks.

Extra resources for Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition) (Big Nerd Ranch Guides)

Show sample text content

During this bankruptcy, we are going to delve deeper into arrays and view another assortment periods: NSSet/NSMutableSet and NSDictionary/NSMutableDictionary. NSArray/NSMutableArray for those who upload an item to an array, the array claims possession of it. for those who get rid of the article from the array, the array provides up possession. Open BMITime, and try the way you are utilizing the staff array. If we forget about all of the different stuff, you notice whatever like this: // Create an array of worker gadgets NSMutableArray *employees = [[NSMutableArray alloc] init]; for (int i = zero; i < 10; i++) { // Create an example of worker worker *person = [[Employee alloc] init]; // positioned the worker within the staff array [employees addObject:person]; } [employees removeObjectAtIndex:5]; staff = nil; you sometimes create an empty mutable array utilizing alloc/init or the category procedure array. for instance, you've got created the mutable array like this: NSMutableArray *employees = [NSMutableArray array]; observe that the addObject: approach provides the thing to the tip of the checklist. As gadgets are further, an array will develop as great as essential to carry them. Immutable gadgets in the event you create an example of NSArray, you assign all its items to it while it truly is created. This as a rule appears like this: NSArray *colors = [NSArray arrayWithObjects:@"Orange", @"Yellow", @"Green", nil]; The nil on the finish is the way you inform the tactic to prevent. therefore, this colours array could in simple terms have 3 strings. (If you omit the nil, it will possibly crash your application. ) so much starting programmers are shocked by way of the life of NSArray. Why could an individual need a record that can’t be replaced? There are purposes: You don’t belief the folk you're employed with. that's, you need to allow them to examine an array, yet you don’t wish them to have the option switch it. A gentler process is to offer them an NSMutableArray, yet inform them it truly is an NSArray. for instance, think the subsequent approach: // Returns an array of 30 unusual numbers - (NSArray *)odds { static NSMutableArray *odds = [[NSMutableArray alloc] init]; int i = 1; whereas ([odds count number] < 30) { [odds addObject:[NSNumber numberWithInt:i]; i += 2; } go back odds; } somebody calling this technique assumes it's returning an immutable NSArray. If the caller attempts so as to add or get rid of goods from the again item, the compiler will factor a stern caution – although, it really is, in truth, an example of NSMutableArray. the opposite cause is functionality: an immutable item by no means should be copied. With a mutable item, it's possible you'll make a personal reproduction so you understand that no different code within the method can swap it from beneath you. this can be pointless for immutable items. in truth, whereas the replica approach to NSMutableArray makes a brand new replica of itself and returns a pointer to the hot array, the reproduction approach to NSArray does not anything – it simply returns a pointer to itself. accordingly, immutable gadgets are relatively universal in Objective-C programming.

Download PDF sample

Rated 4.29 of 5 – based on 34 votes