Glow-Inc / GLCalendarView

A fully customizable calendar view acting as a date range picker
MIT License
855 stars 106 forks source link

Loading nib from main bundle fails #4

Closed teut closed 9 years ago

teut commented 9 years ago

Great pod! But I encountered a small problem...

I tried to integrate your calendar view in another app (through cocoa pods) and encountered this exception:

*\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </private/var/mobile/Containers/Bundle/Application/B235DCB6-6243-4A1D-A82A-EFAD5E27E930/myapp.app> (loaded)' with name 'GLCalendarDayCell''

This is because the .xib is loaded from the main bundle (bundle:nil) at GLCalendarView.m:81

[self.collectionView registerNib:[UINib nibWithNibName:@"GLCalendarDayCell" bundle:nil] forCellWithReuseIdentifier:CELL_REUSE_IDENTIFIER];

Changing this to this line instead, makes it work.

[self.collectionView registerNib:[UINib nibWithNibName:@"GLCalendarDayCell" bundle:[NSBundle bundleForClass:self.class]] forCellWithReuseIdentifier:CELL_REUSE_IDENTIFIER];

Would you be so kind as to update the pod with this fix?

Thanks a lot!

ltebean commented 9 years ago

you can use v1.2.1, thanks.