setText: is deprecated help in 3.0 SDK

Discussion in 'iOS Programming' started by boyplunder, Jun 19, 2009.

  1. boyplunder macrumors regular

    boyplunder

    Joined:
    Sep 8, 2008
    Location:
    UK
    #1
    Working in the 2.2 SDK I have resolved all of the issues I did have as I worked through the new App. When I upgraded to the 3.0 SDK, I now get 5 warning messages that say something like:

    Warning: 'setText:' is deprecated at... and a file path to UIKit.framework 'UITableViewCell.h'

    I have read the notes and entries that discuss the deprecate issue, but am not entirely sure I understand what it all means. As far as I can tell, my App is fine, but a few changes to the code will make it completely compatible with the new 3.0 software. But I can also see that changing things to suit 3.0 could make it incompatible with earlier versions on most people's hardware.

    What I can't tell is if Apple will allow it through or not.

    It all works fine in the Simulator for both 3.0 and earlier settings. [Will be testing on the device in the next day or so. Although I only have a 3.0 iPhone currently.]

    Would anyone wiser than me explain where we are with the deprecated warnings and what the best approach should be. If anyone is having similar experiences, please share what you are doing on this point.
     
  2. Saladinos macrumors 68000

    Saladinos

    Joined:
    Feb 26, 2008
    #2
    Don't worry too much about deprecated warnings. These calls still work in 3.0, and may or may not work in later versions. It's not an immediate problem. They usually work pretty much forever for compatibility though.

    If you check the header file where this is declared, you'll see that you have to set 'text' on the textLabel property of the cell.

    So it's cell.textLabel.text = @"Hi there!";
     
  3. boyplunder thread starter macrumors regular

    boyplunder

    Joined:
    Sep 8, 2008
    Location:
    UK
    #3
    That's fine. Seems I did understand it about right.
    Apple seem to have changed the syntax of the code a little. Just when I thought I'd cracked it. More bedtime reading. :eek:

    Thanks for your input.
     
  4. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #4
    To me, deprecated pretty much means, not guaranteed to exist in any future version. So if you can get rid of your deprecated calls sooner rather than later, the better but they will be fine for the 3.0 SDK.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    You want to be a little careful with this though. If you remove the deprecated calls, your app will no longer run under 2.x OS. If you're okay with a 3.0-only app, sure, go for it. But I suspect there will be a significant number of users who don't upgrade immediately and you don't want them thinking you suck because your app doesn't run on their fairly recent OS.
     
  6. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #6
    Fair point. Personally, I'm already making the move to making my app 3.0 only. I can't think of any good reason why most iPhone users wouldn't make the jump quickly although there is the drawback of iPod touch users having to pay.
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    I can't either, really. But I wouldn't be surprised... :)

    Myself, I'm keeping my iPhone at 2.2.1 for now, in case I need to troubleshoot users on the old OS, while my iPod touch had been on 3.0 for a while now. Kinda wish I'd reverse that but I don't think I kept a 2.2.1 iPod touch firmware on hand.
     
  8. mbarron macrumors newbie

    Joined:
    Mar 30, 2009
    #8
    Disadvantage of releasing 2.2.1 ?

    I hope I can jump in here with a related question. I develop on an iPod Touch.
    I have a very basic App. I switched my iPod to 3.0. Do you agree with the following plan?

    1. I can test on my device only 3.0 - on Simulator for both.
    2. I release a version for 2.2.1 and tell Apple that it is 2.2.1.
    It will run therefore on unupdated iPod Touches, I get a somewhat
    larger customer base, and Apple will not complain, because it will
    run on 3.0

    To restate this quickly, what is the disadvantage of testing 3.0 hardware
    but releasing 2.2.1 ?

    Do I have the picture right?"

    Many Thanks for reading, Mark
     
  9. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #9
    Probably a minor disadvantage but it's there: there may be differences in how your app runs on an actual device under 2.2.1 versus how it runs on the simulator. Since you claim you have a basic app, that's probably not a big issue. But the potential is still there...
     

Share This Page