0

I am a newbie in Mac development as I am trying for the first time to port my iPhone app on mac.

This might look a silly question to all experienced developers but please be fair with me as I don't know much about Mac programming.

I started a new project on mac and it was all good.The application was opening and I could see the window opened.

As I wanted to implement a movie player I followed Simple Movie Player Tutorial by Apple and after that tried to open the app.Now when app launches I can't see window of the application.I need to open a video from File menu which makes the application window to appear.I want the window to appear right at the app launch!

Please help as all my search got in vain and I strongly feel that this is the right place to get the right direction.

Thanks!

Yogi
  • 3,578
  • 3
  • 35
  • 56

1 Answers1

1

That appears to be the way that particular app works. It requires a movie file. There's no such thing as a new, untitled document for that app. From the bottom of the page you linked to: "When the player launches, you can open and play any QuickTime movie of your choice. Simply locate a .mov file and launch the movie from the File > Open menu in your media player application."

It appears that the recorder application that you will build in later steps of the tutorial opens a window at launch.

One other thing to be aware of: as of Lion, due to the application resume feature, launching an app will not always open a new, untitled document. Lion will try to restore the application to the state it was in when you quit it. Since this tutorial was written before that feature existed, it doesn't have explicit support for it.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
  • That makes sense.But in my app I want the user to be able to play only the videos provided by my app.This thing can be easily achieved in an iOS app using MPMoviePlayerController but how to do it in a Mac app? – Yogi Apr 20 '12 at 07:42
  • You may not want to use Cocoa's document-based app architecture for your app, in that case. In a Mac app, you have a few possible places where you can start doing stuff. Two good choices are in the app delegate. One is the `-applicationDidFinishLaunching:` method, the other is the `-applicationOpenUntitledFile:` method. Implement those to present a window and off you go. (It sounds like you still have to learn a lot before getting there, though.) – Ken Thomases Apr 20 '12 at 08:47
  • Yes..I have to.Thanks for the help though.I will try the suggested ways. – Yogi Apr 20 '12 at 08:51
  • Superb...The answer deserves up voting.Exactly what I wanted. – Yogi Apr 20 '12 at 10:23