On Jul 6, 2015, at 7:46 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> I'm having a heck of a time connecting UIViews to my classes. I have a 
> UICollectionViewCell subclass with a bunch of subviews. One of those is 
> custom.
> 
> While I can drag from views to the Swift code for the UICollectionViewCell 
> subclass, it keeps trying to connect it to a storyboard in a completely 
> unrelated project in a separate directory. It appears to do the right thing, 
> but at runtime the outlet is nil, and clicking on the little dot by the line 
> of code pops up a menu referencing this other storyboard.*
> 
> There's a custom subview in the cell that's also implemented in a Swift file. 
> I want to connect subviews of that to it, but Xcode won't prompt to create 
> the IBOutlet when I drag from those.
> 
> I can't figure out what's going on, but it's very broken. I've tried cleaning 
> and restarting Xcode to no avail.
> 
> *The UICollectionViewCell subclass view hierarchy was dragged over from 
> another storyboard in another project. That's the file my new project keeps 
> trying to reference, but I can't figure out why. The other project isn't even 
> open when this happens. I've looked inside the pbxproj file and the 
> storyboard file, and there are no references to that other file. But Xcode 
> keeps showing it.
> 
> I've reported this behavior in bugreporter, but I'm really stuck here.

I’ve occasionally had issues getting Xcode to connect outlets and actions. My 
workaround for it is to open the Assistant view, and drag from your view into 
the source file, and let Xcode create an outlet or action automatically. Then 
you can delete the one it created and it should work with the one you already 
had.

Charles

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to