Deprecated UITableViewCell Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in iOS 3.0

accessoryAction

The selector defining the action message to invoke when users tap the accessory view. (Deprecated in iOS 3.0. Instead use the tableView:commitEditingStyle:forRowAtIndexPath: or tableView:accessoryButtonTappedForRowWithIndexPath: for handling taps on cells.)

@property(nonatomic) SEL accessoryAction
Discussion

If you specify a selector for the accessory action, a message is sent only if the accessory view is a detail disclosure button—that is, the cell's accessoryType property is assigned a value ofUITableViewCellAccessoryDetailDisclosureButton. If the value of this property is NULL, no action message is sent.

The accessory view is a UITableViewCell-defined control, framework control, or custom control on the right side of the cell. It is often used to display a new view related to the selected cell. If the accessory view inherits from UIControl, you may set a target and action through the addTarget:action:forControlEvents: method. See accessoryView for more information.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

editAction

The selector defining the action message to invoke when users tap the insert or delete button. (Deprecated in iOS 3.0. Instead use the tableView:commitEditingStyle:forRowAtIndexPath: or tableView:accessoryButtonTappedForRowWithIndexPath: for handling taps on cells.)

@property(nonatomic) SEL editAction
Discussion

When the cell'€™s table is in editing mode, the cell displays a green insert control or a red delete control to the left of it. (The selectedBackgroundView constant applied to the cell via the editingStyle property determines which control is used.) Typically, the associated UITableView object sets the editing action for all cells; you can use this property to alter the editing action for individual cells. If the value of this property is NULL, no action message is sent.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

font

The font of the title. (Deprecated in iOS 3.0. Instead, set the fonts of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic, retain) UIFont *font
Discussion

If the value of this property is nil (the default), UITableViewCell uses a standard font optimized for the device.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

hidesAccessoryWhenEditing

A Boolean value that determines whether the accessory view is hidden when the cell is being edited. (Deprecated in iOS 3.0. Use the editingAccessoryType and editingAccessoryView properties instead.)

@property(nonatomic) BOOL hidesAccessoryWhenEditing
Discussion

The default value is YES.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

image

The image to use as content for the cell. (Deprecated in iOS 3.0. Instead use the imageView property to get UIImageView object and then get or set the encapsulated image.)

@property(nonatomic, retain) UIImage *image
Discussion

The default value of the property is nil (no image). Images are positioned to the left of the title.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

lineBreakMode

The mode for for wrapping and truncating text in the cell. (Deprecated in iOS 3.0. Instead set the line-break mode attribute of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic) UILineBreakMode lineBreakMode
Discussion

For further information, see the UILineBreakMode constants described in NSString UIKit Additions Reference. The default value is UILineBreakModeTailTruncation.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

selectedImage

The image to use a cell content when the cell is selected. (Deprecated in iOS 3.0. Instead use the imageView property to obtain the UIImageView object and then get or set its highlightedImage property.)

@property(nonatomic, retain) UIImage *selectedImage
Discussion

The default value of this property is nil (no image).

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
See Also
Declared In
UITableViewCell.h

selectedTextColor

The color of the title text when the cell is selected. (Deprecated in iOS 3.0. Instead set the highlightedTextColor property of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic, retain) UIColor *selectedTextColor
Discussion

If the value of property is nil (the default), the color of text in a selected cell is white.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

target

The target object to receive action messages. (Deprecated in iOS 3.0. Instead use the tableView:commitEditingStyle:forRowAtIndexPath: or tableView:accessoryButtonTappedForRowWithIndexPath: for handling taps on cells.)

@property(nonatomic, assign) id target
Discussion

The target object receives action messages when the user taps a cell'€™s insert button, delete button, or accessory view. The default value is nil, which tells the application to go up the responder chain to find a target. Note that the target is a weak reference.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

text

The text of the cell. (Deprecated in iOS 3.0. Use the textLabel and detailTextLabel properties instead.)

@property(nonatomic, copy) NSString *text
Discussion

The default is nil (no text).

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

textAlignment

A constant that specifies the alignment of text in the cell. (Deprecated in iOS 3.0. Instead set the text alignment of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic) UITextAlignment textAlignment
Discussion

If the value of the property is nil (the default), the title is left-aligned (UITextAlignmentLeft). See the descriptions of the UITextAlignment constants for alternative text alignments.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

textColor

The color of the title text. (Deprecated in iOS 3.0. Instead set the text color attribute of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic, retain) UIColor *textColor
Discussion

If the value of property is nil (the default), the color of text is black.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Declared In
UITableViewCell.h

initWithFrame:reuseIdentifier:

Initializes and returns a table cell object. (Deprecated in iOS 3.0. Use initWithStyle:reuseIdentifier: instead.)

- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
Parameters
frame

The frame rectangle of the cell. Because the table view automatically positions the cell and makes it the optimal size, you can pass in CGRectZero in most cases. However, if you have a custom cell with multiple subviews, each with its own autoresizing mask, you must specify a non-zero frame rectangle; this allows the table view to position the subviews automatically as the cell changes size.

reuseIdentifier

A string used to identify the cell object if it is to be reused for drawing multiple rows of a table view. Pass nil if the cell object is not to be reused.

Return Value

An initialized UITableViewCell object or nil if the object could not be created.

Discussion

This method is the designated initializer for the class. The reuse identifier is associated with those cells (rows) of a table view that have the same general configuration, minus cell content. In its implementation of tableView:cellForRowAtIndexPath:, the table view's delegate calls the UITableView method dequeueReusableCellWithIdentifier:, passing in a reuse identifier, to obtain the cell object to use as the basis for the current row.

Availability
  • Available in iOS 2.0 and later.
  • Deprecated in iOS 3.0.
Related Sample Code
Declared In
UITableViewCell.h