Skip to main content

Object Initialization

  • Chapter
Book cover Learn Objective-C on the Mac
  • 682 Accesses

Abstract

So far, we’ve created new objects in two different ways. The first way is [SomeClass new], and the second is [[SomeClass alloc] init]. These two techniques are equivalent, but the common Cocoa convention is to use alloc and init rather than new. Typically, Cocoa programmers use new as training wheels until they have enough background to be comfortable with alloc and init. It’s time for your training wheels to come off.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Mark Dalrymple and Scott Knaster

About this chapter

Cite this chapter

Dalrymple, M., Knaster, S. (2009). Object Initialization. In: Learn Objective-C on the Mac. Apress. https://doi.org/10.1007/978-1-4302-1816-6_10

Download citation

Publish with us

Policies and ethics