Welcome, Guest. Please login or register.
Did you miss your activation email?
April 30, 2017, 03:29:53 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Answers to Exercises
| | |-+ Chapter 10
| | | |-+ Chapter 10, Ex. 1
Pages: [1] Go Down
Author Topic: Chapter 10, Ex. 1 (Read 1400 times)
Posts: 4

on: May 18, 2011, 01:07:57 PM

I was wondering, do we have to call the "setWidth:andHeight" method in our initializer?  Can we just do something like this:
Code: (Objective-C)
-(Rectangle *) initWithWidth:(float)w andHeight:(float)h {
self = [super init];

if (self) {
width = w;
height = h;
return self;

To me (a newbie!), it seems odd to be already calling instance methods on an object that we are just now initializing.  It seems like we should do first things first, get the instance set-up and ready to go, then we can call methods on it.

Nitpicking??  Huh
Pages: [1] Go Up
Jump to:

Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.