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 11-11-2010, 04:32 PM   #1 (permalink)
Yko
Registered Member
 
Join Date: Sep 2010
Posts: 26
Yko is on a distinguished road
Default UITableViewCell not using the custom UITableViewCell

Hey guys,

I have a UITableViewController created programmatically without a XIB file like so:

@interface VideoViewController: UITableViewController

I have a navigation controller and a tabBar on the app delegate. All are done programmatically. So, here's the code inside init:

Quote:
self.title = @"Video"
[[self navigationItem] setTitle = @"Video"];

// I did not have to do this for it to work normally but I did it just in case
[[self tableView] setDelegate:self];
So, anyways, I try to create a custom UITableViewCell by following this tutorial:
Custom UITableViewCell Using Interface Builder | iCodeBlog

Everything looks great. Basically, the custom cell was created using a XIB file and then in IB, it is tied to the VideoViewCell class. Perfect.

But, when I try to use it, the VideoViewController does not display anything.

Quote:
- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"VideoViewCell";
VideoViewCell *cell = (VideoViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[VideoViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
}

[[cell backgroundView] setBackgroundColor:[...];
In the custom cell, there's a UIView that serves as the background view. When I build and run, it shows blank. When I run the debugger, the cellForRowAtIndexPath is fine and everything checks out. It just seems to get replaced by the native cell of the UITableViewController instead of the custom cell.

When I click on the cell, my original function still works.

I'm at a lost. Can someone please direct me?

Thanks!!!!
Yko is offline   Reply With Quote
Old 11-12-2010, 08:26 AM   #2 (permalink)
Yko
Registered Member
 
Join Date: Sep 2010
Posts: 26
Yko is on a distinguished road
Default

Shameless bump.
Yko is offline   Reply With Quote
Reply

Bookmarks

Tags
uitableview, uitableviewcustomcell

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: 357
7 members and 350 guests
apatsufas, Kirkout, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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