Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:13:54+00:00 2026-06-17T19:13:54+00:00

I keep running into a problem when I try to write to a label

  • 0

I keep running into a problem when I try to write to a label in a custom cell. So right now, I have a class with a table view called “AccountViewController” and I have a class with my custom cell “AccountViewCell. I can get my cell to correctly display in my table, however I run into a problem when I try to link the label in my custom cell to their outlets and when I write to the labels.

Right now my code is:

AccountViewController.h

#import <UIKit/UIKit.h>
#import <GameKit/GKSession.h>
#import <GameKit/GKPeerPickerController.h>

@interface AccountViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
{

    NSArray     *tableData;
    int         cellValue;
    NSString    *cellContents;

}

@property (nonatomic, retain) NSArray   *tableData;
@property (nonatomic, retain) NSString  *cellContents;
@property (nonatomic, retain) NSString  *accountSelected;
@property (nonatomic, retain) NSString  *accountList;
@property (nonatomic, retain) NSString  *amount;

@end

AccountViewController.m

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [tableData count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    NSString *CellIdentifier = @"AccountViewCell";
    AccountViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        // Load the top-level objects from the custom cell XIB.
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"AccountViewCell" owner:self options:nil];
        // Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
        cell = [topLevelObjects objectAtIndex:0];
    }

    // cell.accountNameLabel.text = [tableData objectAtIndex:indexPath.row];

    return cell;

}

AccountViewCell.h:

#import <UIKit/UIKit.h>

@interface AccountViewCell : UITableViewCell


@property (nonatomic, weak) IBOutlet UILabel *accountNameLabel;
@property (nonatomic, weak) IBOutlet UILabel *accountNumberLabel;
@property (nonatomic, weak) IBOutlet UILabel *balanceLabel;

@end

AccountViewCell.m

#import "AccountViewCell.h"

@implementation AccountViewCell

@synthesize accountNameLabel = _accountNameLabel;
@synthesize accountNumberLabel = _accountNumberLabel;
@synthesize balanceLabel = _balanceLabel;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self)
    {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end

Again, my code works fine and displays my custom cell when I don’t try to set a label’s text or connect the outlets to the labels in AccountViewCell as shown here:

https://i.stack.imgur.com/lCRV6.png

My cell Identifier is correct: https://i.stack.imgur.com/0ODt1.png

Now, the problem is when I connect the outlets like this: https://i.stack.imgur.com/bIMm8.jpg

The code will break, even if I don’t set or declare the labels in AccountViewController.m It gives me this error:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<AccountViewController 0x104b2220> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key accountNameLabel.'
*** First throw call stack:
(0x248e012 0x1d2be7e 0x2516fb1 0x815711 0x796ec8 0x7969b7 0x7c1428 0xd620cc 0x1d3f663 0x248945a 0xd60bcf 0xd6298d 0x28e54 0xbfff4b 0xc0001f 0xbe880b 0xbf919b 0xb9592d 0x1d3f6b0 0x287ffc0 0x287433c 0x2874150 0x27f20bc 0x27f3227 0x27f38e2 0x2456afe 0x2456a3d 0x24347c2 0x2433f44 0x2433e1b 0x29e37e3 0x29e3668 0xb4565c 0x49b2 0x2c45)
libc++abi.dylib: terminate called throwing an exception

I need a way to be able to write to the label. I’ve tried everything I could think of and read many threads, however I cannot figure this out. If someone could please help and could show me a way to write to a label in a custom cell, that would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:13:55+00:00Added an answer on June 17, 2026 at 7:13 pm

    Ok, I figured it out. I should not have been linking the labels via file owner but instead via the table cell.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep running into the following problem: (System.Console.ReadLine ()).Split [|'('; ')'|] |> Array.filter (fun
I keep running into this design problem, and I'm not happy with my solution
I keep running into slight variations of a problem in Java and it's starting
I've been researching everywhere to solve this problem, but I keep running into a
So I am running into a problem with getting the right data from my
Keep running into When using the multi-mapping APIs ensure you set the splitOn param
I keep running into the same testing Failure, and I can't figure out quite
I keep running into enq: TX - row lock contention, when I run the
I keep running into this error MemCacheError (Broken pipe): Broken pipe on my Rails
I've been using RhinoMocks lately but I keep running into an issue. If I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.