0

I've search almost every related question, but still can not find a clue...

Here is what I did:

1.Create a scrollView using storyboard.

2.Programticaly created 10 myController(which are UITableViewControllers) inside the scrollViewController, So I can use panGesture to switch between tables. and it's working fine.

3.Created a tableViewController using storyboard, set myController to be the corresponding view controller.

4.Embedded the tableViewController in navigation controller.

5.Control drag from tableViewController to a new view controller to create a push segue.

6.Setup segue identifier in storyboard.

enter image description here

The Problem is:

A. When try to segue programmaticaly: use [self performSegueWithIdentifier:@"test" sender:self]; in tableView:didSelectRowAtIndexPath: method.

The exception shows all the time:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MyTableViewController: 0x8b413c0>) has no segue with identifier 'test''

B. Than I tried prepareForSegue: but it has never been called.

C. I've checked the segue identifier...there is no problem at all.

What's happening here??? Anyone has any idea???

EDIT:

ScrollViewController and TableViewController are separately created on the same storyboard. no connection/segue between them.

PIC Updated.

Strong84
  • 1,869
  • 2
  • 19
  • 24
  • Is there anything wrong with the way I setup navigation controller? Do I need to programmaticaly set navigation controller for MyTableViewController instance inside ScrollViewController? – Strong84 Dec 30 '13 at 16:13
  • Do I need to create segue from scrollViewController (not TableViewController) to webViewController? – Strong84 Dec 31 '13 at 00:30
  • I suggest you start small. Instead of programmatically creating 10 of your controllers, try to create just one in the storyboard. I'm pretty that's where your problem is coming from. P.S. Stacking many table view controllers looks like a design flaw. Are you sure that's necessary? – Pier-Luc Gendreau Dec 31 '13 at 04:01
  • 10 UITableViewControllers inside another VC? Do you mean UITableView? Or really UITableViewController??? – CaptJak Dec 31 '13 at 15:11
  • @Pier-LucGendreau I think you are probably right! Thanks a lot! – Strong84 Dec 31 '13 at 16:24
  • @CaptJak I mean UITableViewController: 10 tableviewcontrollers are created inside a scrollviewcontroller. – Strong84 Dec 31 '13 at 16:25
  • @Pier-LucGendreau In order to achieve the same goal, what approach do you suggest? Instead of programmatically creating 10 table view controllers, is there any other ways? – Strong84 Dec 31 '13 at 16:59
  • @CaptJak If there is a design problem, what design do you suggest? – Strong84 Dec 31 '13 at 17:01
  • It's hard to suggest, I do not know what you are trying to achieve. Why do you need 10? I suggest editing your question and adding an outline of your app and how you expect it to flow. – CaptJak Dec 31 '13 at 18:19
  • It's hard to tell, but if you find yourself hacking a solution around something that shouldn't be hard, then there's probably something wrong with the design. – Pier-Luc Gendreau Dec 31 '13 at 22:51
  • See method 1 in this question to manually push a controller that's within a storyboard without using a segue: http://stackoverflow.com/questions/9047146/alternative-ways-to-push-view-controllers-with-storyboard-programmatically – Pier-Luc Gendreau Dec 31 '13 at 23:00

0 Answers0