Receiver has no segue with identifier - ios4

I have a problem that I've been sitting with all the day. I have a super view which contains UIPageControl and UIScrollView, in this super view. I have created a sub view which contains three images, three labels, and three buttons. Each button has a touch up event. When the button event is triggered the super view will be promoted by a new view. For doing that, I created a segue which connected with super view and new view. Here is the connection code in the super view.
`
<connections>
<outlet property="pageControl" destination="ivy-0Q-UQo" id="rGm-sh-mdE"/>
<outlet property="scrollView" destination="4Yu-Qb-kbF" id="aqY-ou-cv4"/>
<segue destination="zZo-CH-P2Y" kind="push" id="xBU-ZO-u7s"/>
</connections>
`
This piece of code will guarantee the connection between the super view and the new view is okay,
here is the touch up event code.
WelcomeFrameViewController *welcomeFrameVC = [WelcomeFrameViewController alloc]; //super view instance
NSLog(#"=======================");
[welcomeFrameVC performSegueWithIdentifier: #"ForwardToLogin" sender: self];
When I run the program, the compiler complains with
2012-08-20 10:17:02.325 TTRen[2440:f803] ============44===========
2012-08-20 10:17:02.352 TTRen[2440:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver WelcomeFrameViewController: 0x688e960 has no segue with identifier 'ForwardToLogin''
I am quite new in iOS, any suggestions will be deeply appreciated.

'Receiver WelcomeFrameViewController: 0x688e960 has no segue with
identifier 'ForwardToLogin''
In your storyboard, check that you actually have a segue named "ForwardToLogin"

There does seem to be a bug with xCode (still in 6) where storyboard changes you make aren't get copied to the simulator. You can reset the Simulator's Content & Settings to resolve this.
Other things to check:
Check the naming of your segue. Check it again. Check it some more :-)
Ensure that your segue is pointing in the right direction. It needs to point away from the UIViewController that calls performSegue….
Ensure you don't have two copies of your view controller on top of each other, with the segue attached to the one on top, and you instantiating the one underneath!
There's a similar question here and I encountered the same problem too. The reset fixed it for me.

Related

ios7 navigationbar causes EXC_BAD_ACCESS after VC with keyboard shown dismiss

I have a Notes-like app: UITableViewController showing up individual notes by pushing them onto navigation stack.
The problem arises when I have UITextView with the FirstResponder status (keyboard is shown) and I touch Back button. The current view controller is dismissed with the animation as expected, BUT the navigation bar is broken now! If I press any of the bar buttons, it will cause EXC_BAD_ACCESS.
I would say that it was not transitioned properly. The table VC is broken somehow as well, as it may appear empty on further manipulations... Very strange behaviour!
By the way, it did not cause any problems with iOS5 and iOS6, but there I used a custom chevron Back button.
I've checked the standard Notes app and it works like a charm.
What is the trick?
Thanks a lot for your advice!
EXC_BAD_ACCESS means you are trying to access an object that has been deallocated. Best thing you can do to trace this is enabling NSZombie, it will tell you what released object is being sent a message (aka EXC_BAD_ACCESS).
You can get how to enable it from here.
I got it and will try to explain to help somebody else to save their day...
EXC_BAD_ACCESS was raised because UITableViewController was not properly transitioned to during Back pop-animation (its viewWillAppear: and viewDidAppear: method were not triggered at all).
In its turn, the animation was not properly performed, as popViewControllerAnimated: was called twice or even more times: 1) as part of the system Back-button callback; 2) inside textViewDidEndEditing: in case no text was entered.
The solution is to check whether the back button has been pressed before calling popViewControllerAnimated:. The trick is to check if the detail-view controller is still in the navigation stack.
Here is the helper method:
-(void) returnToTheListOfRecords {
self.textView.delegate = nil; // this is to avoid the second call of `textViewDidEndEditing:`
if ([self.navigationController.viewControllers indexOfObject:self.delegate]==NSNotFound) {
// Back button has been pressed.
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
The problem happens on iOS7 only due to its brand-new animation.

Accessing UITextView from another class

I've currently got two view controllers A and B, A uses a segue to push B and this works back and forth nicely, however based on some button presses in view controller B i want to change the text within a UITextView in controller A.
I've had a look at previous posts but i'm a novice at present and was confused by the way in which i should go about doing this.
I'd love to be able to get my head around how interactions are best done between various parts of the app. Also i was wondering if there is a way i can tap into a segue returning to trigger some other code.
Thanks
Edit:
OK perhaps i was a little bit limited with my information, from what i can gather reading other posts they are manually creating a variable for the viewcontroller (A) in viewcontroller (B) then accessing it in the second view controller (B) and setting a variable (property and synthesize) to edit that way, however i have the viewcontrollers embedded in a navigation controller and using a push setup in the storyboard (GUI system). I'm not sure if i have to create a variable to do this or if because they exist in the storyboard there is another way, if someone could just point me in the direction of a post that helps to explain this (i am looking at the moment too) i'd be very grateful.
OK well here's how i got it to work but i imagine there are:
A: Better ways to do it.
B: Changes depending on your setup.
I had my two view controllers embedded in a navigation controller, and used a segue push to access the second view controller each had a different class (all setup in the storyboard thing).
To get it working for me i did the following:
I have a singleton (a class that stores all my data but is global to the app so the variables can be accessed from anywhere in the app) this allows me to have variables that i can access from any view controller. A great tutorial on this can be found here
I then created an NSString variable (passedNote) and updated the value of this variable from the ViewController B, when my button was pressed.
Next when viewController A is loaded (in the viewWillAppear: (BOOL)animated method) i append or replace the value of the textview (dependent on some logic) I have with the global variable (passedNote).
Hope this helps anyone who had the problem.

Update parent in UINavigationController from SubView

Forgive me if this has been asked/answered already but I couldn't find it anywhere (at least no in Monotouch - vaguely answer for ObjC. So completely new to Monotouch but I have everything completed in my application that I want with one exception. I'm trying to update a parent of a subview.
Here is the scenario:
I have a UINavigationController with a UIView (not a table) which has a few buttons on it that directs via a PushViewController to a Subview. I make some changes on the subview, which I would like reflected back on the parent. I can of course add a manual refresh button if I wanted but was looking for something a little better.
I did see some things that referred to using a viewWillAppear but couldn't find any good examples. My attempts failed pretty bad, so any suggestions would be great.
Thanks,
Richard
If you have a UINavigationController, it has a "back" button on top. Once this is hit by the user (or if you pop to a previous view controller), the currently view controller shown will trigger ViewWillDisappear and ViewDidDisappear and the view below (the one with your buttons) will fire ViewWillAppear and ViewDidAppear. Just overload those and update your UI state in there.

iPhone - UITextField inside NavigationController Crashing App when touched

I have a problem witha UITextField.
Context:
I have a UITabBar Controller with 5 Tabs. Each one has a NavigationController with their related ViewController.
First Tab, has a UITable. When a row in the table is touched, the user is sent to the second tab, and a new view is pushed in the NavigationController.
This new ViewController has a UITextField. When I touch it, the App Crashes with the message in console:
"-[CALayerArray registerDefaults:]:unrecognized selector sent to instance 0x612f280
***Terminating app due to uncoaught exception 'NSInvalidArgumentException', reason: "-[CALayerArray registerDefaults:]:unrecognized selector sent to instance 0x612f280"
Also I've noticed this ViewController also is not responding to Orientation Change... so I assume is something related to the tree...
Everything was constructed with the Interface Builder.
If you have any tip or idea of what can be happening, I'd really appreciate it.
Thank you very much.
in IB, deleting and adding a new UITextField should do the trick.

'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name

I have a window based applicaiton with tab bar and navigation bar integrated into it. On the navigation bar have a custom button which opens a table view.
On clicking on the cell of the table I want to open a new table view controller. But as soon as I click on the cell of first table I get an exception that
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'AddForm''
I have checked that AddForm is in right place.
I have tried all the solutions given above and on other thread, but still stuck. I hope someone can help me.
The flow is something like this
ListButton (on click opens a list view) -> a table view opens -> (on click of a cell should open a new table view Controller and fetch data from core data)
My root view controller code is in the second table view controller file... is that what I am doing wrong? I am doing so because I don't need the core data before that....
Please help
Thanks in advance
I Used to have the same problem first of all check in your AppDelegate.m class if the managedObjectContext is created
if it is created check if it is pass it as argument
something like this
MasterViewController *controller = (MasterViewController *)masterNavigationController.topViewController;
controller.managedObjectContext = self.managedObjectContext;
if that is correct for you main view just be sure that you are passing it through your views something like this
self.detailViewController.managedObjectContext = self.managedObjectContext;
well at least that works for me =)
The most common cause of this problem is misspelling the name of the entity or getting the capitalization wrong. Check that AddForm is spelled exactly the same in the code and the data model editor.

Resources