what is "setTo:over: method"?

Discussion in 'iOS Programming' started by hrithik123, Mar 7, 2010.

  1. hrithik123 macrumors member

    Joined:
    Feb 3, 2010
    #1
    what is "setTo:eek:ver: method"?

    what is the main use of this?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
  3. teek macrumors member

    teek

    Joined:
    Feb 12, 2008
    Location:
    Norway
    #3
    Are you referring to Fraction class in the "Programming with objective-c 2.0" book ?
     
  4. hrithik123 thread starter macrumors member

    Joined:
    Feb 3, 2010
    #4
    yes
     
  5. teek macrumors member

    teek

    Joined:
    Feb 12, 2008
    Location:
    Norway
    #5
    To set the fraction, like 3/8, 2/5 etc.. setTo:3 over:8
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    I personally don't thing setTo: over: is a very well named method. It should really be setNumerator:denominator:
     
  7. skochan macrumors regular

    Joined:
    Apr 1, 2006
    Location:
    California
    #7
    Actually it was between the method name I chose and setNumerator:andDenominator:. I chose the first name because it seemed to "read" better to me. Your suggestion is more consistent with convention (actually, setNumerator:andDenominator: is even more consistent), so overall, it probably is a better choice.

    Cheers,

    Steve
     

Share This Page