PhilippeBoisney / AlertOnboarding

A simple and attractive AlertView to onboard your users in your amazing world.
MIT License
842 stars 109 forks source link

Could not cast value of type 'AlertOnboarding.AlertChildPageViewController' #7

Closed fabioiegri closed 8 years ago

fabioiegri commented 8 years ago

Hi Philippe and thank You for Your job.

I'm trying to use AlertOnboarding on my project but I receive the error:

Could not cast value of type 'AlertOnboarding.AlertChildPageViewController' (0x10d8b53f8) to 'Surf_Shop.AlertChildPageViewController' (0x10d2a6da8).

on:

pageContentViewController = UINib(nibName: "AlertChildPageViewController", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as! AlertChildPageViewController

while the master project works fine.

Could You help me please to solve it? Thank You very much Kind regards Fabio

PhilippeBoisney commented 8 years ago

Hi Fabio,

Did you install the lib manually or via Cocoapod ?

fabioiegri commented 8 years ago

Hi Philippe, thank You for fast reply :) I've installed the lib from cocoapods.

Thank You again Fabio

PhilippeBoisney commented 8 years ago

Very strange... Did you modify the file on Cocoapod folder (Pods). It should be: pageContentViewController = UINib(nibName: "AlertChildPageViewController", bundle: bundle).instantiateWithOwner(nil, options: nil)[0] as! AlertChildPageViewController

Try to update your cocoapod file, maybe you have an old release of AlertOnboarding :) pod update

fabioiegri commented 8 years ago

Philippe, solved.

Here my errors (for other users) 1) I've installed the lib via cocoapods but I've also copied the pod files manually into my project instead of importing AlertOnboarding (import AlertOnboarding). 2) I was using another variable called "alertView" (and I think this was the real problem) so AlertOnboarding wasn't casted (Could not cast value of type 'AlertOnboarding.AlertChildPageViewController')

Thank You very much for Your work with AlertOnboarding. You have rendered a difficult thing simple. Thank You again Best Regards Fabio

PhilippeBoisney commented 8 years ago

Glad to hear that =D Indeed, you have to install AlertOnboard either manually or via Cocoapod. If you do both, it raises an error. See you soon !