help with math functions

Discussion in 'iOS Programming' started by iphonedevelop18, Mar 2, 2009.

  1. macrumors member

    Feb 26, 2009
    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


    Staff Member

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

    As in:
     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