Sunday, November 15, 2009

setFont is deprecated

If we compile our old source with >= 3.x versions, we will get this warning..

1.UITableviewCell

old code for version :
cell.font = [UIFont boldSystemFontOfSize: 16];

the new code will be
[cell.textLabel setFont:[UIFont boldSystemFontOfSize: 16]];

2.UIButton

[cell.aButton.titleLabel setFont:[UIFont boldSystemFontOfSize:16]];

4 comments:

  1. nice one.Thank u for the help,but it does not work for button.

    ReplyDelete
  2. yes, it does. just:
    [aButton.titleLabel setFont...
    for a button on a view. His example is a button that is part of a cell.

    ReplyDelete
  3. Thank u it is working

    with regards,

    Apple1.1 developers

    ReplyDelete