Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-06-2011, 08:16 AM   #1 (permalink)
Registered Member
 
Join Date: May 2011
Location: Salisbury, UK
Posts: 5
RabbitFactoryUK is on a distinguished road
Default UITableView - Unrecogised Selector

Hi again,

Ok, I have a new issue when I try to add a additional tableView to a new view.

The set up I have is as follows :

TabBarController
-NavagationController
-ViewController

No each of the tab bar items has a navagationController and the first nib to load is a Content Page (UITableView) once the user selects an item he/she is directed to the relevant page.

I have successfully created a contents page for the first item in the tab bar.

However once I attempt to create the UITableView for the second item and run the app I get the following error in the console:

-[UIViewController tableView:numberOfRowsInSection:]: unrecogised selector sent to instance 0x5a28770

Now heres the code:

.h

Code:
#import <UIKit/UIKit.h>


@interface Contents : UIViewController <UITableViewDataSource, UITableViewDelegate> {
    NSString * item;
    NSMutableArray *ContentsList;
}

@property (nonatomic, retain) NSString *item;
@property (nonatomic, retain) NSMutableArray *ContentsList;

@end
.m

Code:
#import "Contents.h"

@implementation Contents
@synthesize ContentsList;
@synthesize item;

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    ContentsList = [[NSMutableArray alloc]initWithObjects:
                        @"Content Item One",
                        @"Content Item Two",
                        @"Content Item Three",
                        @"Content Item Four",
                        nil];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [ContentsList count];
}
RabbitFactoryUK is offline   Reply With Quote
Old 05-06-2011, 08:17 AM   #2 (permalink)
Registered Member
 
Join Date: May 2011
Location: Salisbury, UK
Posts: 5
RabbitFactoryUK is on a distinguished road
Default

Please note that this data is copied and pasted from the working table view for the first tab!

Thanks in advance for any help or information!
RabbitFactoryUK is offline   Reply With Quote
Old 05-06-2011, 08:25 AM   #3 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

1. You should have a property for the table view
2. You aren't using your properties correctly. See the link in my signature for guidance.

I'm going to make a guess that you have an issue in MainWindow.xib. You probably have specified a plain UIViewController, when you should have specified Contents.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableview, unrecogised selector

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 356
10 members and 346 guests
dansparrow, iOS.Lover, lorrettaui53, MikaelBartlett, Nobbsy, oztemel, pbart, PlutoPrime, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:57 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0