akkyie/AKPickerView

Last version is not working

guidosabatini opened this issue · 4 comments

Hi,
I'm trying to use your interesting picker.
I imported it in my project using cocoapods but it's not working. The picker simply isn't showing up...
But if I use classes included in the sample project, than it magically works without any other modification of my code.
BTW, my code is exactly equal to yours, I did a "Hello world" app trying to understand why it isn't working.
It seems that initialization (font, text color, ...) now is mandatory.

There is also an issue in collectionView:layout:insetForSectionAtIndex:
if the collectionView has no elements, the app crashes in this line of code (due to lack of check on number!=0)

CGSize firstSize = [self collectionView:collectionView layout:collectionViewLayout sizeForItemAtIndexPath:firstIndexPath];

Thank you for using my control, and I'm sorry for the lack of my debugging.

The first issue is undoubtedly caused by my mistake in AKPickerView.podspec, and I mended it.
But I couldn't confirm the next bug, could you tell me the condition it occured?

You can recreate it simply using an empty array in your demo.
When the picker is created, insetForSectionAtIndex is called: it tries to
get the first object of the array without checking if it's empty
I solved the problem adding

if (number == 0) return UIEdgeInsetsZero;

at row 197 of AKPickerView.m file of the demo

2014-04-28 17:02 GMT+02:00 Akkyie Y notifications@github.com:

Thank you for using my control, and I'm sorry for the lack of my debugging.

The first issue is undoubtedly caused by my mistake in
AKPickerView.podspec, and I mended it.
But I couldn't confirm the next bug, could you tell me the condition it
occured?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-41568939
.

OK I figured it out and fixed it (e695e11).
I'm renewing the CocoaPod/Specs, so please wait a moment for it.
Thanks a lot again for your contribution!

Specs is now updated.