This page shows how easily I can connect outlets http://developer.apple.com/technologies/tools/whats-new.html in Xcode 4, but I can't get it.
I right click and drag an outlet from the new referencing outlet circle, and into my header where the object is declared, but nothing happens.
Has anyone used this?
Thanks a lot
I had the same problem with the final version of Xcode 4 and solved it by selecting the File's Owner Custom Class before using the drag & drop outlet feature like shown on the screenshot below.
Also, fyi, for outlets the item has to be on a window, not just on the background. It will connect fine, but it will not process the outlet gesture. ort11
https://discussions.apple.com/thread/3054574?start=0&tstart=0
this worked for me
In my case I was dragging the outlet from "Outlets/delegate", but it must come from "Referencing outlets".
Related
I duplicated a .xib file and a swift file to adapt to another view quickly. But now from my initial .xib there all my outlets (from this view) have 2 components (the initial and the new created):
How can I remove a link in my case?
Thank you very much!
With right clicking on the object and then click on x.
Or from the connection inspector in the right hand side of the Xcode:
I'm trying to create in IBOutlet in Swift using my Storyboard and assistant editor, but I'm receiving a strange error I've never seen before. Looks Objective-C-ish.
I navigated to my ViewController's Save button in my Storyboard
Then I control-click dragged the Save UIButton to Xcode's assistant editor to make the IBOutlet. I get the error "Could not insert new outlet connection: No #implementation found for the class "ClassBVC". How do I avoid this error so I can make the outlet and an action?
I noticed when I click the button with the four squares before "Manual" and the < > buttons, I can go to "Counterparts" and there's a "ClassBVC" file with the same name, but with "(Interface)" next to it. It's not the file that I need though. Even when trying to create an outlet there, I get the same error.
I had same problem. rebuilding works for me.
Try closing Xcode and opening it again.
Creating one #IBOutlet directly in the view controller, and then creating the reference to the component in the Outlet Section in .storyboard worked for me. After that, I was able to drag the components normally to their respective view controller.
I don't know what happen with my xcode. Im my controller view only have 3 outlets, but interface builder found 5 outlets. My app always crash in runtime.
Problem caused by previously setted outlet been deleted improperly. You can easily fix this problem by deleting invalid outlet from the storyBoard and also, I can see another issue from your screenshot.You have a breakPoint running on your namePromotionalLabel.Hope this help...
This is what you should do:
Remove all connections from button
Add all connections again, after that your app shouldn't show SIGNAL SIGABRT(which I think it does) anymore
Remove all the outlets from the Outlet section in the above screenshot and then try again to draw and outlet.
if still it cause a problem then create a new swift controller file for that view controller and assign the class to that view controller
I think this is so basic but almost people don't mention this.
The problem is view outlet have to connect to main view too.
Almost cases, it's connected automatically.
I've searched for a few hours to try and figure out the answer, but haven't as of yet.
On creating an outlet/action for an iOS app in Xcode 5:
I'm trying to create an outlet (by CTRL-dragging) from a label in Main.storyboard to ViewController.h (which I had to manually select in the Assistant Editor because only UIViewController.h shows up under "automatic")
No "outlet/connection/action" menu shows up when I drag. However, a menu does show up if I try to drag to the UIViewController.h file. (It just then tells me UIViewController.h is locked, and I can't unlock it)
I've also tried putting "ViewController.h" into the custom class part, as that seemed to work for some other askers out there.
I believe it may (?) have something to do with ViewController.h not showing up under "Automatic" in Assistant Editor. I have tried creating an outlet with a different project and that seems to work, and ViewController.h shows up under automatic.
I'd like to have posted a screenshot but I need 10 reputation. Anyway, thanks in advance for your help!
You need to set the Custom Class in the storyboard to a class that you have written that subclasses UIViewController.
Make sure that the scene you are using is under the UIViewController class that you intend on using it with.
Here is how:
Select Scene (click black bar underneath || ctrl+shft+click || Document Oultine)
Select Identity Inspector
Enter UIViewController class of interest under Custom Class
I'm working on my first iPhone app and have been able to get most things done. There's one problem that I've run into a few times and I want to understand the issue better.
In XCode, if I go File->New File->UIViewController subclass and make sure that both UITableViewController subclass and With XIB for user interface are checked, then it creates a MyViewController.h, MyViewController.m, and MyViewController.xib.
When I look at this xib in Interface Builder, you can see that the File Owner has an Outlet called view that is already connected to the UITableView. No problem. This all makes sense and is great.
My issue comes when I've changed the type of my class (or done something else) and some how the "view" Outlet goes away. I get an error saying "view not showing up in file owner outlet".
My question is how do I then reconnect the UITableView as the "view" of the ViewController when the Outlet goes away? The only way I've been able to get it to work is to literally start over with a new xib/viewcontroller.
That "view" outlet should be coming from the parent class (in your case UITableViewController).
What do you mean by change type? If you are changing the name of your class, try using Edit > Refactor with the class name selected in Xcode.
In the "Document" window (cmnd + 0) - control + click on file's owner, a weird looking line thing will show up. drag the mouse over to your view and release. a little drop down will come up from which you can set the view to the File's Owner View outlet.
Typically the "view" outlet would be coming from the parent class (UITableViewController). If it's not showing up, then Interface Builder is not connected to your project than this could happen instead.
My problem was due to an edge case as described here: Interface Builder and Xcode integration not working