Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load NIB in bundle: 'NSBundle with name 'DropDownCell' #23

Closed
tulioht opened this issue Jun 16, 2016 · 6 comments
Closed

Could not load NIB in bundle: 'NSBundle with name 'DropDownCell' #23

tulioht opened this issue Jun 16, 2016 · 6 comments

Comments

@tulioht
Copy link

tulioht commented Jun 16, 2016

GAIUncaughtExceptionHandler(NSException *) (GAIUncaughtExceptionHandler.m:48): Uncaught exception: Could not load NIB in bundle: 'NSBundle </Users/tuliothome/Library/Developer/Xcode/DerivedData/iOSFanfics-enerleptowspyagorhkcphtttefg/Build/Products/Debug-iphonesimulator/DropDown.framework> (loaded)' with name 'DropDownCell'

@kevin-hirsch
Copy link
Collaborator

Hello @tulioht, which version of DropDown are you using?

@tulioht
Copy link
Author

tulioht commented Jun 17, 2016

DropDown Version 1.0
Installed by CocoaPods 1.0.1
I'm using Swift

@IBAction func btnTipoClick(sender: UIButton) {
    let dropDown = DropDown()

    dropDown.dataSource = ["A", "B", "C"]

    dropDown.anchorView = sender
    dropDown.bottomOffset = CGPoint(x: 0, y:sender.bounds.height)
    dropDown.show()
}

@kevin-hirsch
Copy link
Collaborator

Thanks. I will try this and get back to you today (Belgian time) ;)

@kevin-hirsch
Copy link
Collaborator

Okay, first, from what I can see, you have to declare the dropDown outside of this function, otherwise it will be released at the end of the function because nothing is retaining it. Move let dropDown = DropDown() to a view controller property.

@tulioht
Copy link
Author

tulioht commented Jun 17, 2016

Thanks, worked

Just do not understand why it has to be global

@kevin-hirsch
Copy link
Collaborator

The DropDown is like any variable, so it's like:

func function() {
   var a: Int = 0 // Declaration
   a += 2
} // Here, a is not retained outside the function so it will be released

It's the same for the DropDown because when you set an anchorView, this anchorView does not retain the DropDown (not added as a direct subview). And since the DropDown is not yet retained by some view hierarchy (or even if it will be, when DropDown is hidden, it is removed from view hierarchy), it is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants