Maddyhome Forums

Discussions related to software developed at maddyhome.com
It is currently Thu Nov 27, 2014 8:29 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Circular UIPickerView
PostPosted: Wed Dec 17, 2008 5:39 pm 
Offline
Site Admin

Joined: Thu Aug 14, 2008 9:26 pm
Posts: 1912
In the spirit of this time of year I am making available an implementation of a circular picker view. This is a drop in replacement of a standard UIPickerView. This class makes each component in a picker view go around and around in either direction like the UIDatePicker.

This code hasn't been tested with every possible use but it seems to work fine with basic use of row titles.

Just add the CircularPickerView.m and .h files to your own project.

Let me know if you find any issues.

Enjoy.


Attachments:
File comment: Contains the .m and .h for CircularPickerView
CircularPicker.zip [3.37 KiB]
Downloaded 1265 times


Last edited by rmaddy on Thu Sep 24, 2009 9:07 pm, edited 1 time in total.
Updated with latest code.
Top
 Profile  
 
PostPosted: Sat Jan 03, 2009 10:34 pm 
Offline

Joined: Sat Jan 03, 2009 10:29 pm
Posts: 1
thanks.
i'm a newbee developer.

but i have a question,

you said "Just add the CircularPickerView.m and .h files to your own project."

but it does not work...


could you give me a project folder???


Top
 Profile  
 
PostPosted: Sat Jan 03, 2009 10:41 pm 
Offline
Site Admin

Joined: Thu Aug 14, 2008 9:26 pm
Posts: 1912
What do you mean by "it does not work"? Be more specific.

All you need to do is copy the two files into your own project. Import the header file, and use CircularPickerView anywhere you would have used UIPickerView.


Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 1:35 pm 
Offline

Joined: Wed Jun 03, 2009 11:05 am
Posts: 2
Hi, since I am still new, don't know how to deal with those definitions in head file,
id<UIPickerViewDataSource> myDataSource;
id<UIPickerViewDelegate> myDelegate;
I simplely created a viewController and defined a view and a NSArray for PickerView (myPickerView), but had no idea to load it your code so that the picker can show the array.


Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 4:16 pm 
Offline
Site Admin

Joined: Thu Aug 14, 2008 9:26 pm
Posts: 1912
Get your code working with a regular UIPickerView. Once that works then you can replace references to UIPickerView with CircularPickerView.

If you are having trouble with the basics I suggest you visit http://www.iphonedevsdk.com

That site is a great resource for getting help with iPhone development.

Enjoy.


Top
 Profile  
 
PostPosted: Thu Jun 11, 2009 3:36 am 
Offline

Joined: Wed Jun 03, 2009 11:05 am
Posts: 2
Sorry, still can't make it work. In order to load the contents to the picker, I have my own delegate mehtods (on the same view control file) and the following line:
myPickerView.delegate = self;
but that seemed blacking out inside the picker as I replaced all references to CircularPickView. If the line is commented out, the picker looks fine but nothing in there.


Top
 Profile  
 
PostPosted: Thu Jul 22, 2010 3:21 pm 
Offline

Joined: Thu Jul 22, 2010 2:53 pm
Posts: 1
Thanks for your coding...its wonderful, but guys you have to follow the instructions:

- copy the two files to your project
- import the header file in your .h file that has the PickerView (i.e. #import "CircularPickerView.h")
- change every UIPickerView to CircularPickerView ( you could click 'Command f' to find all the UIPickerView words within your files .h and .m easier)
- Open your .xib file that has the Picker View
- select the Picker view by the mouse
- open the inspector and then choose the identity tab
- In the Class field change the UIPickerView to CircularPickerView
- now drag the CircularPickerView from the File's Owner to the PickerView (just check if its already linked then leave it)

Now it should be working fine ... but the problem is the circuling just goes down (one way circuling) and when the view started it looks like a normal Picker View not a Circular...SO I"ve added only one line with .m file (that has the Picker View) and it works just fantastic, the line is assigning a default rows
[cPikerView selectRow:0 inComponent:0 animated:NO];

PS. cPcikerView (in case if your CircularPickerView *cPickerView;)


Thanks :)


Top
 Profile  
 
PostPosted: Sat Nov 13, 2010 11:15 pm 
Offline

Joined: Sat Nov 13, 2010 11:12 pm
Posts: 1
I found this particular thread via Google, so I don't know if there's been any followup. I found your code to be invaluable in my project, but I found a few bugs in the code. If the fixes would be welcome, I'd love to share them.


Top
 Profile  
 
PostPosted: Sat Nov 13, 2010 11:24 pm 
Offline
Site Admin

Joined: Thu Aug 14, 2008 9:26 pm
Posts: 1912
If you found some bugs please send me the details. Thanks.


Top
 Profile  
 
PostPosted: Sat Mar 17, 2012 4:45 pm 
Offline

Joined: Sat Mar 17, 2012 2:54 pm
Posts: 1
Please how do i add this code to my project in order to get the best out of it
Thanks

_________________
www.whitekitchencabinetsstore.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group