Need help with Int math

Discussion in 'iOS Programming' started by lynkynpark86, Dec 23, 2010.

  1. lynkynpark86 macrumors 6502

    #1
    I am trying to have a user-entered time delay (that they input in minutes) and multiply it by 60 to get the number of seconds. Here's my code, but I get an error:
    Code:
    	int alertDelayIntPre = [alertDelayString intValue];
    	int alertDelayInt = [alertDelayIntPre * 60];
    
    I'm getting an "Expected ':' before '}' token" error, but since it's xcode, there's a 0% chance that's the actual problem. I think it's because I used "int * 60". I'm coming from years of applescript, and I thought math worked the same way, but I guess not. I HAVE been searching google and mroogle for 45 minutes now, and i got nothing. Please help me!
     
  2. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
  3. lynkynpark86 thread starter macrumors 6502

    #3
    Wow. How did I screw that up? Thanks for the quick reply!

    :apple: :apple: :apple:
     
  4. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    After a while everything looks like an object. ;)

    B
     
  5. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #5
    Ha, isn't programming fun? :) There are a lot of times when certain words, like my variable or object names, start to look really really "funny" because I've typed them so many time.
     

Share This Page