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

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 12, 2013, 09:17 PM   #1
fypj2013
macrumors newbie
 
Join Date: Mar 2013
How to navigate from one xib to an uitableview(without xib)

Hi i am trying to navigate from one xib to a manually created table cells which have no xib. i have already an app delegate, a rootviewcontroller named: main view controller, a sub class controller: optionviewcontroller and the table cell view which i mentioned : MarineFishViewController . i have pointers that if the table cell does not have any xib, initwithnibname:nil bundle:nil cannot be used. I tried changing using initwithStyle:UITableViewStyleGrouped declared in MarineFishViewController. But i ran into a bad access error.


this is the link to my project folder and there is an image of the error. Please take a look. Thanks!

http://www.mediafire.com/?kh6ngtxklu7g31i
fypj2013 is offline   0 Reply With Quote
Old Mar 13, 2013, 05:28 AM   #2
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
If you post the relevant code (and only the relevant code) here between [code ][/code] tags then people are a lot more likely to help.
ArtOfWarfare is online now   0 Reply With Quote
Old Mar 13, 2013, 09:31 AM   #3
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
fypj2013 , do you understand the difference between a UITableViewCell, a UITableView and a UITableViewController? Because your OP seems to be confusing in regards to how you are describing things.
__________________
dejo is online now   0 Reply With Quote
Old Mar 16, 2013, 07:23 AM   #4
Duncan C
macrumors 6502a
 
Duncan C's Avatar
 
Join Date: Jan 2008
Location: Northern Virginia
 
Quote:
Originally Posted by fypj2013 View Post
Hi i am trying to navigate from one xib to a manually created table cells which have no xib. i have already an app delegate, a rootviewcontroller named: main view controller, a sub class controller: optionviewcontroller and the table cell view which i mentioned : MarineFishViewController . i have pointers that if the table cell does not have any xib, initwithnibname:nil bundle:nil cannot be used. I tried changing using initwithStyle:UITableViewStyleGrouped declared in MarineFishViewController. But i ran into a bad access error.


this is the link to my project folder and there is an image of the error. Please take a look. Thanks!

http://www.mediafire.com/?kh6ngtxklu7g31i
As Dejo says, you sound confused.

You need to create a new view controller that contains a table view, set it up, and then present the new view controller as a modal.

You can't add table view cells to a window outside of a table view.

Using XIB files or storyboards is the best way to create UI for a lot of reasons. You should stop fighting it and use the tools Apple provides. They really are a good thing.

If you are determined to create you UI in code, you can use initWithStyle:reuseIdentifier: to create your table view cells, but you don't create cells initially. Instead you create and display your table view, set up your view controller as the data source, and wait for the table view to call the cellForRowAtIndexPath method. That is when you create cells.
__________________
Regards,
Duncan Champney, WareTo.
Check out our latest iOS app, Face Dancer, available for free on the App Store.
Duncan C is offline   0 Reply With Quote

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
button not appearing on XIB Kapthehat iPhone/iPad Programming 11 Sep 4, 2013 08:59 AM
Loading then Showing a Xib (XCode4)? Fritzables Mac Programming 2 Jan 29, 2013 01:10 AM
Xcode need help: My mainmenu.xib is gone/disappeared jannikn iPhone/iPad Programming 4 Nov 1, 2012 08:34 AM
XIB And Storyboards nashyo iPhone/iPad Programming 1 Aug 22, 2012 07:42 AM
Xcode 4 mainwindow.xib recobafan iPhone/iPad Programming 4 Jul 6, 2012 11:53 AM

Forum Jump

All times are GMT -5. The time now is 05:02 PM.

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

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