help with math functions

Discussion in 'iPhone/iPad Programming' started by iphonedevelop18, Mar 2, 2009.

  1. macrumors member

    Joined:
    Feb 26, 2009
    #1
    i have a line of code that goes like this

    (priceperacre * Sliderbuy.value) = costbuy;

    if ( costbuy < money) {
    (costbuy - money) = money;
    (Sliderbuy.value + acre) = acre;

    it says for the 1st 3rd and 4th lines "invalid Ivalue statement", I assume that those are the wrong ways to command multiply, minus, and plus. So what are the correct math functions to use.
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Um, you have your variable assignments backwards. It's:
    variableName = expression;

    As in:
    Code:
     costbuy = (priceperacre * Sliderbuy.value);
    This is pretty basic Objective-C / C / most-other-programming-languages syntax. I suggest you step back and learn those basics before you continue any real programming.
     

Share This Page