• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: javascript ---> Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: javascript ---> Cocoa


  • Subject: Re: javascript ---> Cocoa
  • From: Sam Stigler <email@hidden>
  • Date: Mon, 26 Nov 2007 00:18:26 -0800

First, I must tell you there is no way to run Cocoa embedded in a web browser; and it's definitely not OS-independent. But if you're looking for a way to get a great UI, plus animation, on the Mac platform, a Cocoa app is definitely the way to go.

Although Web Kit makes it possible for you to embed web pages in your Cocoa application, I'd say a complete rewrite is in your best interest. Chances are you'll find implementations of everything you can do in Javascript in either Objective-C or C (not to mention C++, Python, and Ruby); and it shouldn't be too hard for you to express your application's logic again in whichever language you choose (assuming you know it (-: ). After all, the languages are fairly similar at root -- they all use if-else, for, and so on. Having said that, there's no software out there (at least that I know of) that will take your Javascript and turn it into Objective-C.

I don't have any idea what your app does, or how complex it is, or what its GUI looks like right now, etc; but still... Here are some suggested steps I might take if I were in your position (take these with a grain of salt because some people prefer to write the model first, etc.):
1) Open Xcode and create a new Cocoa Application. Make it be document-based if it needs to save to disk, Core Data-based if it needs to manage a lot of data, and Quartz Composer-based if you want to be able to easily add one or more Quartz Compositions into it.
2) Double-click on MainMenu.nib and use Interface Builder to design a nice-looking, easy-to-use UI using the standard controls provided. Pay particular attention to Web View (part of Web Kit) for integrating web pages into your Cocoa app (although it might be best from a UI standpoint just to get rid of them completely).
3) Assuming you already know Cocoa, and that your existing application isn't overly complex: In your Xcode project, create a new Objective-C class for your model, and populate it with the IBActions and IBOutlets that you need for your UI. Connect them up in IB and work from there. A good starting point is http://developer.apple.com/documentation/Cocoa/index.html .


	I hope this helps.

-Sam


On Nov 25, 2007, at 11:31 PM, Apparao wrote:

Hi All,

I have developed a application using html and Javascript. Now I am interested to replace javascript part with Cocoa -- for better UI look and feel and animation effects.

	Can any body suggests -- easiest way for conversion?.

TIA,
- Apparao.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: javascript ---> Cocoa
      • From: "Ulhas Morbale" <email@hidden>
References: 
 >javascript ---> Cocoa (From: Apparao <email@hidden>)

  • Prev by Date: Possible to control animation of appearance of images in IKImageBrowserView
  • Next by Date: Re: IKImageBrowser performance issues
  • Previous by thread: javascript ---> Cocoa
  • Next by thread: Re: javascript ---> Cocoa
  • Index(es):
    • Date
    • Thread