Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

UITableView keeps freezing

KingofChaosKingofChaos Posts: 25Registered Users
edited July 2012 in iPhone SDK Development
Hello, I followed this tutorial on how to make a UITableView, Creating a simple TableView based iPhone application in xCode 4.2 - YouTube
And whenever I click the button that goes to the next view controller, it freezes and gives me these errors:
Click Here For Image

Any help would be appreciated.
Post edited by KingofChaos on

Replies

  • DomeleDomele Posts: 2,954Registered Users
    edited June 2012
    Copy paste your console (it's the text where it says "terminate called throwing an exception).
    If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.



    New app - See screenshots and details at www.globaclock.com.



    If you want to
  • KingofChaosKingofChaos Posts: 25Registered Users
    edited July 2012
    Sorry for the late reply, my computer wasnt letting me acces the forums, it was saying something about malware.

    2012-07-03 09:30:55.227 LYWAM Tour[350:f803] -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x6d8d110
    2012-07-03 09:30:55.233 LYWAM Tour[350:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x6d8d110'
    *** First throw call stack:
    (0x13c8022 0x1559cd6 0x13c9cbd 0x132eed0 0x132ecb2 0x1f006b 0x1f2862 0xa066d 0xa0167 0xa3134 0xa7623 0x50d42 0x13c9e42 0x1d80679 0x1d8a579 0x1d0f4f7 0x1d113f6 0x1d10ad0 0x139c99e 0x1333640 0x12ff4c6 0x12fed84 0x12fec9b 0x12b17d8 0x12b188a 0x12626 0x1ddd 0x1d45)
    terminate called throwing an exception(lldb)
  • iAppDeveloperiAppDeveloper Posts: 37Registered Users
    edited July 2012
    the error is in your - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section method, post the code of this method that we can have a look at it
  • BrianSlickBrianSlick Posts: 9,404Tutorial Authors, Registered Users
    edited July 2012
    No it isn't. The delegate message is being sent to a plain UIViewController object. Somewhere the custom view controller should be specified instead.
  • KingofChaosKingofChaos Posts: 25Registered Users
    edited July 2012
    iAppDeveloper;440296 said:
    the error is in your - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section method, post the code of this method that we can have a look at it

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    return [tableData count];
    }
  • KingofChaosKingofChaos Posts: 25Registered Users
    edited July 2012
    So I've been trying everything to try and fix this, I even set up a custom cell to see if that would work, using this code:

    //
    // ViewController.m
    // LYWAM Tour
    //
    // Created by Alan Raff on 6/28/12.
    // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
    //

    #import \"ViewController.h\"

    @interface ViewController ()

    @end

    @implementation ViewController
    @synthesize tableView1;
    @synthesize array;


    - (void)viewDidLoad
    {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    grommetext1.keyboardType = UIKeyboardTypeNumberPad;


    }

    - (void)viewDidUnload
    {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    }

    #pragma mark

    - (NSInteger)tableView:(UITableView *)tableView
    numberOfRowsInSection:(NSInteger)section
    {
    return 10;
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    NSString *uniqueIdentifier = @\"customerCell\";

    CustomerCell *cell = [tableView1 dequeueReusableCellWithIdentifier:uniqueIdentifier];

    if(cell == nil)
    {
    NSArray *views = [[NSBundle mainBundle] loadNibNamed:@\"CustomerCell\" owner:nil options:nil];

    for (id obj in views) {
    if([obj isKindOfClass:[UITableViewCell class]])
    {
    cell = (CustomerCell*)obj;
    break;
    }
    }
    }
    return cell;
    }




    @end



    Then I get this in the output:

    2012-07-04 23:39:51.961 LYWAM Tour[1931:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x686f140> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key image1.'
    *** First throw call stack:
    (0x13ca022 0x155bcd6 0x13c9ee1 0x9c2022 0x933f6b 0x933edb 0x94ed50 0x23671a 0x13cbdea 0x13357f1 0x23526e 0x236eb7 0x2c4c 0xaec54 0xaf3ce 0x9acbd 0xa96f1 0x52d42 0x13cbe42 0x1d82679 0x1d8c579 0x1d114f7 0x1d133f6 0x1d12ad0 0x139e99e 0x1335640 0x13014c6 0x1300d84 0x1300c9b 0x12b37d8 0x12b388a 0x14626 0x278d 0x26f5)
    terminate called throwing an exception
Sign In or Register to comment.