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 8236361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:06:38+00:00 2026-06-07T19:06:38+00:00

i’m trying to code up a simple table view > detail app to start

  • 0

i’m trying to code up a simple table view > detail app to start getting familiar with obj-c. i use a dictionary to popolate the table, than clicking on a cell i get to a blank detail view. this work (i say it proudly). things get worst when i try to send information to the detail view, here’s the debug error i get:

2012-07-12 14:32:41.906 StoryboardTutorial[79624:f803] -[UIView setText:]: unrecognized selector sent to instance 0x6eae8d0

2012-07-12 14:32:41.908 StoryboardTutorial[79624:f803] Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UIView setText:]: unrecognized selector sent to instance 0x6eae8d0’*

**First throw call stack:
(0x13ca022 0x155bcd6 0x13cbcbd 0x1330ed0 0x1330cb2 0x2d41 0xdba1e 0xdbd11 0xed8fd 0xedaef 0xeddbb 0xee85f 0xeee06 0xc8a852d 0xeea24 0x27bd 0xa55c5 0xa57fa 0x93a85d 0x139e936 0x139e3d7 0x1301790 0x1300d84 0x1300c9b 0x12b37d8 0x12b388a 0x14626 0x1c4d 0x1bb5 0x1)
terminate called throwing an exception(lldb)

and here’s some chunks of code:

DetailViewController.h

//  DetailViewController.h

#import <UIKit/UIKit.h>

@interface DetailViewController : UIViewController{
    NSString *city;
    NSString *state;
    IBOutlet UILabel *cityLabel;
    IBOutlet UILabel *stateLabel;
}

@property (nonatomic,retain) NSString *city,*state;
@property (retain,nonatomic) IBOutlet UILabel *cityLabel,*stateLabel;


@end

DetailViewcontroller.m

//  DetailViewController.m

#import "DetailViewController.h"

@implementation DetailViewController
@synthesize city,state,cityLabel,stateLabel;

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    stateLabel.text = state;
    cityLabel.text = city;

}

ViewController.m

-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
    detail.city = [dataSource objectAtIndex:indexPath.row];
    detail.state = [states objectForKey:detail.city];
    [self.navigationController pushViewController:detail animated:YES];
    UITableViewCell *cell;
    cell = [tableView cellForRowAtIndexPath:indexPath];
    cell.textLabel.shadowColor = [UIColor clearColor];
}


- (void)setupArray{
    states = [[NSMutableDictionary alloc] init];
    [states setObject:@"Roma" forKey:@"Lazio"];
    [states setObject:@"Milano" forKey:@"Lombardia"];

    dataSource = [states allKeys];
}
  • 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-07T19:06:40+00:00Added an answer on June 7, 2026 at 7:06 pm

    UIView doesn’t have a setText method. The UIView you’re talking to needs to have a property text in order to have a method setText

    The error is most likely in one of these lines

    stateLabel.text = state;
    cityLabel.text = city;
    

    One of these must not be the type of object you think it is (aka a UIView instead of a UILabel). Unless you’re calling setText somewhere else.

    Try changing it to

    if ([stateLabel isKindOfClass:[UILabel class]]) stateLabel.text = state;      
    if ([cityLabel isKindOfClass:[UILabel class]]) cityLabel.text = city;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:

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.