Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can see the different style in Apple's <a href="http://developer.apple.com/library/ios/documentation/userexperience/conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html#//apple_ref/doc/uid/TP40007451-CH3-SW1" rel="nofollow">Table View Programming Guide for iOS</a>, what you may want is the UITableViewCellStyleSubtitle (Figure 1-7 in the guide). Please have a look.</p> <p>You can set the second label with <code>cell.detailTextLabel.text = @"my text"</code>.</p> <p>You've got to change this line</p> <pre><code>cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; </code></pre> <p>to</p> <pre><code>cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; </code></pre> <p>using the right style: UITableViewCellStyleSubtitle.</p> <p><strong>EDIT</strong></p> <p>To format a string like you described in your comment:</p> <pre><code>NSString *location = @"a Location"; NSString *date = @"20m ago"; NSString *subtitle = [NSString stringWithFormat:@"%@ on %@", location, date]; </code></pre> <p><strong>EDIT 2</strong></p> <pre><code>NSString *subtitle = [NSString stringWithFormat:@"Found on location ("%f","%f") on date %@", p.x, p.y, p.date]; </code></pre> <p>Please have a look at <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html" rel="nofollow">String Programming Guide / Formatting String Objects</a> for more detail on how to format numbers etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload