Note that there are some explanatory texts on larger screens.

plurals
  1. POResolving compile-time error regarding custom cells
    primarykey
    data
    text
    <p>I am writing an app in iOS 6. This is a snippet of code from ViewController.m file:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomCellIdentifier"]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; cell = _customCell; _customCell = nil; } cell.firstName.textLabel = @"dsdsds"; cell.middleName.textLabel = @"N/A"; cell.lastName.textLabel = @"daasdsdasa"; return cell; } </code></pre> <p>These lines of code give me error (<code>Property 'firstName' not found on object of type 'CustomCell*'</code>):</p> <pre><code>cell.firstName.textLabel = @"dsdsds"; cell.middleName.textLabel = @"N/A"; cell.lastName.textLabel = @"daasdsdasa"; </code></pre> <p>CustomeCell.h:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface CustomCell : UITableViewCell @property (strong, nonatomic) IBOutlet UILabel *firstName; @property (strong, nonatomic) IBOutlet UILabel *middleName; @property (strong, nonatomic) IBOutlet UILabel *lastName; +(NSString*) reuseIdentifier; @end In the Outlets of CustomCell.xib: firstName -&gt; label middleName -&gt; label lastName -&gt; label Referencing Outlets: customCell -&gt; File's Owner Selecting the firstName label: Referencing Outlets: firstName -&gt; CustomCell firstName -&gt; CustomCell -CustomCellIdentifier Selecting the middleName label: lastName -&gt; Custom Cell - CustomCellIdentifier middleName -&gt; Custom Cell Selecting the lastName label: lastName -&gt; Custom Cell middleName -&gt; Custom Cell- Custom Cell Identifier </code></pre> <p>So, what is the prob? In my opinion it has something to do with Outlets.</p>
    singulars
    1. This table or related slice is empty.
    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. 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