Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Jan 24, 2009, 01:06 PM   #1
macrumors 6502
Join Date: Jan 2009
Kochan 2.0 Exercise 10-2 ....a question

The exercise:
Given that you label the method developed in exercise 1 the designated initializer for the Rectangle class, and based on the Square and Rectangle class definitions from Chapter 8, add an initializer method to the Square class according to the following declaration:
-(Square *) initWithSide: (int) side;


We have covered type "id" on page 194, and designated initializers on page 206. Would it be more correct to declare "id" as the return value data type than (Square *)? OR have we not reached this point yet?
mdeh is offline   0 Reply With Quote
Old Jan 24, 2009, 08:46 PM   #2
macrumors newbie
Join Date: Jan 2009
Location: Moreno Vallley
Send a message via Yahoo to TotalLuck
I think it should be (Square *)

After the last problem in chapter 9, I am assuming that if you know the type I object that you are working with , then you would use that object (Square *) Instead of (id).
Finding my inner Nerd
NEVER EVER make a drunken bet or you could wind up with a picture like mine.
TotalLuck is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Broadcom BCM43xx 1.0 ( win7 driver ValleyPirate Windows, Linux & Others on the Mac 5 Mar 1, 2011 09:10 PM
Kochan 2.0 Exercise 12-6 mdeh Mac Programming 0 Jan 27, 2009 12:27 AM
Kochan 2.0 Exercise 11-3 mdeh Mac Programming 4 Jan 26, 2009 02:22 PM
Kochan 2.0 Exercise 10-6 mdeh Mac Programming 2 Jan 25, 2009 11:46 AM
Kochan 2.0 Exercise 8-7 Possible with NSLog? mdeh Mac Programming 3 Jan 17, 2009 09:04 PM

All times are GMT -5. The time now is 12:05 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC