UIPickerView obj-c/js mix

Forum for posting sample code and examples, new posts creation is not allowed, but everybody can comment

UIPickerView obj-c/js mix

Postby sunny » Sun Sep 20, 2009 11:50 pm

This project shows basic APIs to create and control UIPickerView
APIs available:
1. ShowPicker()
2. HidePicker()
3. SetValueForRowInComponent(componentIndex, rowIndex, value)
4. ShowSelection()
5. clearAllComponents

See screenshot for details
Attachments
nkuipicker.zip
(14.63 KiB) Downloaded 213 times
Screen shot 2009-09-21 at 00.44.13.png
Screen shot 2009-09-21 at 00.44.13.png (245.68 KiB) Viewed 1405 times
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: UIPickerView obj-c/js mix

Postby dsmurl » Mon Sep 21, 2009 5:23 am

Where is the sample code? Where is the project?

- Sam
dsmurl
 
Posts: 5
Joined: Sun Sep 13, 2009 5:16 am

Re: UIPickerView obj-c/js mix

Postby sunny » Mon Sep 21, 2009 8:08 am

yesterday when I wrote that sample code it was very late and I forgot to attach the file, now post edited and file attached
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: UIPickerView obj-c/js mix

Postby dsmurl » Wed Sep 23, 2009 6:23 am

So how and when does

- (NSString*)methodResult

as I see it's the only message with a return, yet I see no call to it?

- Sam
dsmurl
 
Posts: 5
Joined: Sun Sep 13, 2009 5:16 am

Re: UIPickerView obj-c/js mix

Postby sunny » Wed Sep 23, 2009 10:12 am

every time you want to call obj-c method actually 5 methods called if they are implemented:
setParameters:
setWebView:
setCurrentPage:
- your method here called //if it's sync method to return result save it to variable
methodResult // return your previously saved result here
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: UIPickerView obj-c/js mix

Postby ryubr » Tue Dec 01, 2009 4:34 am

Hello sunny,

Since the changes on the NimbleKit to prevent the Apple rejection due a possible "private api usage" does this code works on 1.6.x? I'm about to use it, but since this change can you help me?

Thanks :-)

sunny wrote:every time you want to call obj-c method actually 5 methods called if they are implemented:
setParameters:
setWebView:
setCurrentPage:
- your method here called //if it's sync method to return result save it to variable
methodResult // return your previously saved result here
ryubr
 
Posts: 53
Joined: Fri Jun 19, 2009 5:36 am

Re: UIPickerView obj-c/js mix

Postby sunny » Tue Dec 01, 2009 11:20 am

obj-c/js mix files will work, but the project is created using old version of NimbleKit, so I recommend to create new project from template and copy needed files from old project.
also you need to modify source a little, just rename obj-c/js method names
setParameters: -> setNKParameters:
setWebView: -> setNKWebView:
setCurrentPage: -> setNKCurrentPage:

As you may see I created project NKCatalog in sample code folder with NimbleKit installer, for now it does not include all the features, but soon I will move to that project all obj-c/js mix classes as well as the rest of the features. That project will be always up to day with every release of NimbleKit.
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: UIPickerView obj-c/js mix

Postby procom » Sat Jan 02, 2010 1:16 pm

Hello Sunny,

I would like to use NKUIPicker in a new project 1.6.2 but I do not know what to copy from old project.

Happy new year Nimblekit
procom
 
Posts: 91
Joined: Sun Aug 23, 2009 11:49 pm

Re: UIPickerView obj-c/js mix

Postby sunny » Sat Jan 02, 2010 4:46 pm

copy all files which aren't created by template. for instance, you should not copy APP_NAMEDelegate.m file as it was created automatically.
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: UIPickerView obj-c/js mix

Postby sunny » Sat Jan 02, 2010 5:16 pm

actually, better don't change anything yet as I will recreate sample projects today by myself and you will be able to just download it. Wait a little.
User avatar
sunny
Staff
 
Posts: 1787
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Next

Return to Sample Code

Who is online

Users browsing this forum: No registered users and 1 guest