Amazon.com Widgets square programme
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 24, 2014, 01:08:44 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
Print
Author Topic: square programme  (Read 1231 times)
water removal
Newbie
*
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;
Logged

MarkCooperstein
Newbie
*
Posts: 19


Email




« 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.
Logged
talha_sadi1
Newbie
*
Posts: 1


Email




« 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
Logged
Pages: [1]   Go Up
Print
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.