Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fypj2013

macrumors newbie
Original poster
Mar 12, 2013
6
0
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
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,557
6,057
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.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
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.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.