Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Jul 9, 2010, 10:56 AM   #1
macrumors newbie
Join Date: Jul 2010
UITableViewController not receiving events

I am still new to the iPhone SDK, and I find it pretty confusing. I have, until now, only used managed languages like Java, C#, VB.NET, and some Python.

Here's code that adds a table to the screen. The table shows up on the screen, but its contents do not. The methods that should fill them in are never entered.

PHP Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
// Override point for customization after app launch. 
tv = [[UITableView allocinitWithFrame:CGRectMake(2020500500style:UITableViewStylePlain];
tableController = [[*descendent of UITableViewControllerallocinit];
tv.delegate tableController;
//tv.backgroundColor = [UIColor greenColor];
[window addSubview:tv];
window makeKeyAndVisible];


Here's one of the methods that refuses to be called in the delegate:

PHP Code:
- (void)viewDidLoad
super viewDidLoad];
// Configure the table view.
self.tableView.rowHeight 73.0;
self.tableView.backgroundColor DARK_BACKGROUND;

Entry point:

PHP Code:
#import <UIKit/UIKit.h>

int main(int argcchar *argv[]) {
NSAutoreleasePool pool = [[NSAutoreleasePool allocinit];
int retVal UIApplicationMain(argcargvnil, @"*Implementor of UIApplicationDelegate*");
pool release];

Tiiba is offline   0 Reply With Quote
Old Jul 9, 2010, 11:44 AM   #2
macrumors 68020
PhoneyDeveloper's Avatar
Join Date: Sep 2008
Don't do it like that. UITableViewController makes its own table. Don't try to associate a view controller with a view like this. If possible try not to add views directly to a window. (I know that it has to be done once at the start of an app.)

Start with the NavBar app from template. It shows how to do this and it works. If you don't want to see a navbar then make it hidden. You will save yourself a lot of grief if you use a navbar controller.
PhoneyDeveloper is offline   0 Reply With Quote
Old Jul 10, 2010, 07:27 AM   #3
forum user
macrumors regular
Join Date: Aug 2008
And set self.tableView.rowHeight = 73.0;
as a return value in
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
That's part of the UITableViewController.
Fuel Log Evo: The Cost Manager App for any Vehicle
forum user is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhoto events not adding? But shows under Photos... benguild Mac Applications and Mac App Store 3 Sep 27, 2013 07:03 PM
Mail (on MBP, not iPhone 4) not receiving emails from Gmail SimonBook Mac Applications and Mac App Store 5 Sep 14, 2010 07:16 AM
mail not receiving all messages and not sending any messages jimbob61 Mac Applications and Mac App Store 2 Jul 18, 2010 07:23 PM
UITableViewController not scrolling with momentum tonyw iPhone/iPad Programming 2 May 28, 2009 03:47 PM
Not receiving Email Notifications? arn Site News 19 Jun 18, 2003 11:31 PM

All times are GMT -5. The time now is 11:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC