Can't Use "setIntValue"

Discussion in 'iOS Programming' started by sheepopo39, Aug 15, 2010.

  1. macrumors 6502

    Joined:
    Sep 18, 2008
    #1
    I've recently started programming for the iphone/ipad. I can program in Objective-C on the Mac.

    For some odd reason, "setIntValue" is not available on the iphone/ipad sdk, and I was wondering what the equivalent of it was?

    Edit: Found you had to use SetValue, but you have to convert it to a string first. Anyone know another way to do it without having to convert it to a string, as this is a waste of time. Why did apple remove the setXValue from the UIKit?
     
  2. macrumors 603

    Joined:
    Aug 9, 2009
    #2
  3. thread starter macrumors 6502

    Joined:
    Sep 18, 2008
    #3
    Okay, so I got it to work by adding this line of code
    "[label setValue:[NSString stringWithFormat:mad:"%d", i]];"

    But it over laps anything that was there before, is there any other way?

    So the question is, is there a method in the iphone/ipad sdk that will have the same function as setXValue?

    Edit: All of the other methods of doing it that I found, all had the new text overlapping the old text. Won't this be a problem if you need to often change the value in the same textField?
     
  4. macrumors 603

    Joined:
    Aug 9, 2009
    #4
    The text property of UILabel?

    I see no value property for UILabel or its superclasses. Is there a compiler warning for setValue:?

    What type is your 'label' variable? Its name suggests UILabel type, but you mention "textField", so it's unclear. FWIW, UITextField has no value property, either, but it has a text property.

    Are you running on the simulator?


    What are the other methods? Be specific.

    How did you find those other methods?
    I found the text property quite easily in the UILabel and UITextField reference docs.
    http://developer.apple.com/iphone/l...eference/UILabel_Class/Reference/UILabel.html
    http://developer.apple.com/iphone/l.../UITextField_Class/Reference/UITextField.html

    Google search terms:
    uilabel iphone reference
    uitextfield iphone reference
     
  5. macrumors 6502

    Joined:
    Sep 17, 2007
    #5
    There would not be a problem. Reason being that you don't know how the property setter is implemented and you shouldn't care. You just need to supply a NSString object. If you don't want to keep creating new NSString objects, maybe you can try NSMutableString.
     

Share This Page