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 01-09-2009, 09:27 PM   #1 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 1
emptycrawford is on a distinguished road
Default Adding UITableView as a subview

Ok, I'm probably just stupid, and this is probably a question that gets passed around a bunch, but I'm new to Objective-C, and I'm running low on ideas. Basically, I have a main view to which I've added a UIImageView as a subview with no problems. Now, I want to add a transparent UITableView to that. The tableView works fine by itself, but as a subview, it crashes. I think it has something to do with how it's initialized in my main view controller:

Code:
tableView = [[MyTableViewController alloc] init];
And later...

Code:
[contentView addSubview:tableView];
Like I said, it works great when skip the main view and point the appDelegate straight to MyTableViewController, but to add it as a subview crashes the simulator.

Anyway, this is my first post, so be kind.

Thanks in advance,
emptycrawford
emptycrawford is offline   Reply With Quote
Old 05-20-2009, 08:25 PM   #2 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 6
heyyou is on a distinguished road
Default

I am in the same boat. New to the who iphone programming but I am trying to do a UITableView in as a subview. I have been struggling with this and I'm hoping you figured something out. Can you provide any help?
heyyou is offline   Reply With Quote
Old 05-20-2009, 09:10 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2008
Posts: 236
dagamer34 is an unknown quantity at this point
Default

Table views require two things: a delegate as well as a data source (and you will need to your classes to implement the UITableViewDelegate and UITableViewDataSource protocols and tell your table view to use your custom class for those data points). If those two things aren't set, your application will crash.

Also, I'd recommend learning to use the console in XCode. It will tell you why your application is crashing. It should be under the "Run" menu.
dagamer34 is offline   Reply With Quote
Old 05-20-2009, 09:58 PM   #4 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 6
heyyou is on a distinguished road
Default

Thank you for the quick response. I have decided to scrap the subview idea and instead of building it in the interface builder I am building it just from XCode.

This has been a painful journey, but man have I learned a lot in this short amount of time.
heyyou is offline   Reply With Quote
Reply

Bookmarks

Tags
addsubview, subview, uitableview

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: 406
10 members and 396 guests
7twenty7, apatsufas, Eclectic, fiftysixty, JackReidy, teebee74, tim0504, UMAD, yomo710, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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