Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2017, 09:47:15 AM
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
| |-+  Program Examples
| | |-+  Chapter 8
| | | |-+  square programme
Pages: [1]   Go Down
Author Topic: square programme  (Read 2136 times)
water removal
Posts: 1

WWW Email
« on: March 17, 2011, 02:40:08 AM »

code fragment:  [self setWidth: s andHeight: s];

Is it legal to use as an alternative to this fragment, the following?

width = s; height = s;

Water Removal

Posts: 19

« Reply #1 on: May 19, 2011, 08:53:47 AM »

yes, as long as you are talking about instance variables height and width and you are making assignment within a method where height and width are ‘known’  (ie: rectangle.m or square.m file).  Making the assignment as in:

width = s;
height = s;

might be more efficient from a runtime perspective as it is just making as assignment whereas:

[self setWidth: s andHeight: s];

has more overhead as it is a function call.
Posts: 1

« Reply #2 on: December 06, 2011, 11:28:47 AM »

It seems that the total program isn't here. when i first learn program by w3school it's lessons are really Conveyancing me. day by day i am improving my skill. now i can make very tiny program. any way thanks
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.