javascript ---> Cocoa

  • 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.
  • 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.
  • Hello Sam,

    I am having the same problem, but not getting out of it. Actually I want to
    communicate with the flash(.swf) file in the website using C++ on MAC OS X
    10.4
    As you are telling that we can embed web pages in cocoa app using Web Kit,
    is it possible to communicate (transfer string data) with the flash .swf
    file in the web page from C++ using the Carbon or Cocoa framework(second
    option after Carbon). Can I call C++ from JavaScript & vice versa? which
    will be the best option to use shared library or Java Native Interface(JNI).

    Any HELP/API's/tutorials/sample apps are greatly appreciated.

    Thanks in advance
    Regards,
    Ulhas
    ----- Original Message -----
    From: "Sam Stigler" <sstigler_lists...>
    To: "Apparao" <apparao...>
    Cc: <cocoa-dev...>
    Sent: Monday, November 26, 2007 1:48 PM
    Subject: Re: javascript ---> Cocoa

    > 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.

    >
    >
  • I hope following URL would help you

    http://developer.apple.com/documentation/Cocoa/Conceptual/
    DisplayWebContent/index.html?http://developer.apple.com/documentation/
    Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html

    - Apparao.
    Effigent Inc,.

    On Nov 29, 2007, at 1:06 PM, Ulhas Morbale wrote:

    > Hello Sam,
    >
    > I am having the same problem, but not getting out of it. Actually I
    > want to
    > communicate with the flash(.swf) file in the website using C++ on
    > MAC OS X
    > 10.4
    > As you are telling that we can embed web pages in cocoa app using
    > Web Kit,
    > is it possible to communicate (transfer string data) with the
    > flash .swf
    > file in the web page from C++ using the Carbon or Cocoa framework
    > (second
    > option after Carbon). Can I call C++ from JavaScript & vice versa?
    > which
    > will be the best option to use shared library or Java Native
    > Interface(JNI).
    >
    > Any HELP/API's/tutorials/sample apps are greatly appreciated.
    >
    > Thanks in advance
    > Regards,
    > Ulhas
    > ----- Original Message -----
    > From: "Sam Stigler" <sstigler_lists...>
    > To: "Apparao" <apparao...>
    > Cc: <cocoa-dev...>
    > Sent: Monday, November 26, 2007 1:48 PM
    > Subject: Re: javascript ---> Cocoa
    >
    >
    >> 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.

    >>
    >>

    >
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today