Xcode tap gesture causing error - ios

I created two views in Xcode using the hierarchical view layout. I initially created a button on the first page (PlaylistMasterViewController) which activates the segue method to transition to the next page in the hierarchy (PlaylistDetailViewController), which worked just fine. I then deleted the button, and added a tap gesture to one of the UIImage view elements in the masterViewController and deleted the button. I created the action outlet of the touch gesture to activate the segue and made sure to delete all of the uses of the button in my code, yet this error is thrown once right after the splash screen loads (run time). Any ideas what might be causing this?

In your storyboard check your PlaylistMasterViewController for a connected outlet named showPlaylistDetail with a little while exclamation mark next to it. Then hit the 'x' and clear that outlet connection.
It's most likely some outlet you previously connected and later removed from your code.
The image below is just an example to show you what it would look like.

most common - you have outlet from ViewController to your deleted button in storyboard

You might have deleted the button but something in the view itself may still be referencing it. As the view is loaded at runtime when you try to bring up the view it may have UIButton connected to an outlet that no longer exists.
Open the view in Interface Builder and make all the ui elements in that view are properly wired up and not referencing a non-existent IBOutlet. If there is a problem you'll see a yellow warning icon to indicate a problem.

Related

UIStoryboard segue fail

I created a simple Show segue by dragging from a UIButton to another UIViewController in storyboard view. It's configured as all of my other VCs and has a custom class that is specified, with linked IBOutlets and IBActions (which appear to link up when I hover on them).
NOTE: When I first created it, there was no view controller class specified. I've recreated it several times since then, but I'm wondering if some value is cached that's pointing to a default view controller. Although I get print lines from the correct view did load method...
For some reason, when I run the app and click the button it links to a black, empty view controller. The navbar pops up without any back button (these views are embedded in UINavigationController).
After looking up other posts about this kind of issue, I've deleted and recreated the segue, cleaned my build folder and restarted Xcode. There's no source code involved in this, just storyboard configuration. Any help on next steps?
According to the code shown in your screen shot, the problem would be that NodeEnrollmentViewController is a subclass of UINavigationController. That's wrong. It should be a subclass of UIViewController.
You cannot (and do not need to) segue from a view controller within a navigation controller to a navigation controller.

Illegal configuration. Connection "cell" cannot have a prototype object as its destination

I have 2 errors
"Illegal configuration. Connection "cell" cannot have a prototype object as
its destination"
Connections dont duplicate, cells are empty, without other controls in them. I try to clean project and rebuild it, but it didnt help me. How can I fix it? Thank you
Are you trying to link outlets of the cells (or elements of the cells) directly to the view controller? That would be a problem.
If you want your table view to always have the same content, you can change its content to "static cells" in the storyboard, and then you can link it like that.
If you want the table view cells to change dynamically, you cannot do it that way. You need to create a UITableViewCell subclass for your cells, and create the outlets there.
If this doesn't help at all, please explain your problem a bit better.
You probably have an outlet from something like your view controller that's connected to a prototype cell in a table view. An outlet is a to-one relationship. The cell is going to be instantiated many times, so this doesn't make sense, and is an error.
The problem might be that the outlet from the ViewController was not connected to the desired object at all, although it might be connected from the desired object to the ViewController.
for example: the IBAction outlet can be seen from the UIButton's connection inspector for "touch up inside" as linked to the ViewController's IBAction method, but the ViewController's connection inspector will not link the IBAction method to the UIButton.
Same error when I copied/pasted the admob banner view from the official sample into my tableViewCell and connected the IBOutlet from viewController. So, Tiago Lira's explanation worked for me and I created the custom cell class and added banner iboutlet there. Thus the compile time error got resolved. The above question should be accepted.
The only reason for this error is that you have copied a storyboard item- It might be whole view controller or any sub element like the view, button, and label etc. So now the problem is that they have linked each other and now you have to find what is it and delete it.
But if you have copied the whole view controller and you have checked
all possible links you could but still you getting error then this
trick is for you- Copy the main view of that view controller and
delete that VC then a make new VC and paste the copied view in that
VC, so your constraints are safe you just have to give top, bottom,
left and right constraints for the main view.
I found a solution. I delete and add new cell many times, and finally project build without errors

ios methods becoming zombies

I added uiviewcontroller subclass in my arc enabled project, i added a button created the ibaction for it and inside it contains no code, all done through interface builder no manual code, but when i am tapping the button i am getting exc_bad_acess. Instrumentation saying its a zombie attack when pressing button. I really dont understand whats going wrong. I created the new project and done the same thing it is working perfectly. Same thing happening when i am defining method to dismiss keyboard (resign first responder).
this generated when i crtl+dragged from button to interface implementation, i choose the ibaction and name and this code is generated.
- (IBAction)pushh:(id)sender;
and the implementation inside .m file
- (IBAction)pushh:(id)sender {
}
thats all ...
Just to wrap up the offline conversation, a couple of thoughts:
Your zombie is undoubtedly a result of the ecnObj falling out of scope. If it's an ivar of the view controller, then that premature release problem goes away.
You do not want to create a new view controller and then use its view in transitionFromView. If you want to transition between view controllers (in iOS5) you should use pushViewController or presentViewController (or if you're using a container view controller, you can pursue transitionFromViewController). See View Controller Programming Guide's discussion of "Presenting View Controllers from Other View Controllers".
My solution was to delete the button iboutlet in ib, also delete the ibaction in ib, and then connect it back.

UIButton is Filling Screen

I have a problem where the button's I have added to .xib file are filling the screen when I run the application in the iPhone simulator. In Interfacce Builder, the UI appears exactly as I want it. It is added in Interface Builder, and it is correctly linked to the proper view controller. The button is not being manipulated in the code. Code someone point out some settings to check. This is an error that has been there for a few and days, and I can't seem to fix it.
The view hierarchy is (if this helps):
MainWindow
TabController
FirstView
SecondView
ThirdView
In FirstView.xib, in the document outline under objects, there is a root view, which contains the UIButton in question.
One possibility is that the button is added as the view, instead of a subview of the view. It sometimes happens, when you move a button around -- particularly from within the hierarchy list, it accidentally becomes the view (of the viewController) instead of be a subview.
Most probably is that you have not configured correctly the resizing of the button. You can either set it in code or using the interface builder.
For the interface builder solution select the button and open the "Size Inspector". You will see that there is an autosizing feature, adjust to your need and you are done.

How to edit floating view added to scene dock in storyboard?

I have a view controller on my storyboard set up with a tableview. I want to have another view as a floating view on top of the table view. So, I drag a view (actually a toolbar object) and drop it into the scene dock so that in code I can add it to the subviews and position it so that it floats. I have no questions about the coding; just laying out the view in storyboard.
How do I open the view object that I added to the scene dock so that I can add buttons to it, etc., and design it visually?
I know it's possible since I did it accidentally in another project. The toolbar was in the view controller's scene dock and displayed separately with it's own scene dock. It's very frustrating knowing it can be done, but not knowing how to do it!
(source: bikibird.com)
!
Okay, this is how I did it (also by accident).
I had created an (IBAction) and was trying to connect to a button. So I drug a line from my code to the button (in the list of items). For some reason it wouldn't connect so it seemed to hover over it for a few seconds.
All of a sudden the view (with the button) popped out and displayed next to my uiviewcontroller just like you described. I had done this also by accident, but this is the first time I managed to get it to work for me.
Let me know if this works for you as well!!!
I dont know how to show a view like in your picture, but to design a view visually i put it, for example, as head view on my TableView, design it and put it back to the dock.
It's only a workaround, but that helps me.
All I had to do was drag a UI object (in my case it was a UISlider) from the object explorer on the right into the view I wanted to pop out in the scene explorer on the left

Resources