cocos2d mac application how to add splash screen when launching (Default.png) - objective-c

i am migrating my iOS app onto mac. the loading time is a bit long (around 5 seconds) thus i need a splash loading screen (Just like Default.png image for iOS) but the project made from cocos2d template just shows a white screen. not sure about other apps. so is there anyway to set it?
I know that the screen size is not fixed on a mac app. but i have set a default size. and use auto scale in case of full screen mode.
EDIT:
I have tried a light weight loading scene as well but failed since the MainScene itself is light weight as well. I think the major loading time is due to the cocos2d environment set up.

In OS X a window appears when the application launches, it's not designed to use splash screens.You might want to reconsider that choice.
But if the window is still to slow to load or to display its contents, you can still do that but manually, it isn't easy like in iOS.You need to display another view inside the window until it loads.
EDIT
A little more of context: for example you can set in your xib file an image view containing the image do display.
Then you make start another thread that loads all the content that you need.After this, run a selector on the main thread that updates the window.

Based on my tests in Cocos2d 1.0.1 & 2.0 the basic Cocos2d OS X app launches really quickly.
This makes it seem pretty likely that it's something about your first scene that is taking a long time to load, or something else. Instruments can help you gather information about what your app is doing.
I suggest you make an initial lightweight cocos2d scene that will load quickly at startup and then load your second scene and transition to it. Ideally the loading of the assets for your second scene would be asynchronous (at least the ones that are slow). There are numerous blog posts on how to do this. (search for "cocos2d asynchronous loading" and you'll find many, such as this one: How to preload your game assets in a loading scene, though something more recent might be preferable).

Related

WatchKit crash due to accepted event even if not everything is loaded

I have made an extension with a storyboard and some table view. In the simulator all is running ok, but when I try the app on Apple Watch I have some troubles. Since the Apple Watch is slower than the simulator it takes about one second to display the table views. During this time in the place of the table view is displayed nothing. If the user press the empty area that will be filled by the table view, as soon as the table view become visible it will be processed the event associated to the table view. I do not know why but this causes the app crash!!! I think everything would be solved if I do like in the other applications on my Apple Watch that while loading the view shows the rotating circle and not the elements of the view that are already in the storyboard (like buttons and labels) added at compile time.
I have to say that maybe the crashed are due to an use of NSTimer that modify some variables modified by the app, maybe I should use a mutex. But I do not figure how in the Apple Watch the application crashes (or it appears the rotating circle and keep rotating) but in the simulator is ALL OK. What can I do? Do you need additional information? Thanks!

How to remove splash screen at all, so that game loads at once ? Cocos2d + SpriteBuilder

I have my problem still unsolved Splash screen is landscape although the whole game is in the portrait mode. SpriteBuilder + cocos2d , so I see only one way.
How to remove splash screen at all, so that game loads at once ?
This is not possible. An image named Default.png (or under a similar name, depending on the device and what the app supplied) is always loaded when an app launches.
This is done by iOS specifically because no app can technically launch instantly (as in: within a tenth of a second or two).
I know the question is old, but I had the same problem and I solved it specifying none in "Launch screen file" (under General settings).

iOS app launch takes too long to display

Working on first app, have most of the programming done but app is taking too long at launch to display first tableview on tabbar. It takes 8-10 seconds on launch to display. Looking for help on tracking down what code is taking so long, etc. Here is the general app setup: tabbar with 5 tabs including navigation bars, mix of tableviews with detail views and scrollviews. The data for the tableviews is from multiple json feed from a remote web server. In the appdelegate.m I'm setting up the full tab/navigation bars. I get the json data feeds in each individual view controllers that setup on the tabbar. I've used the Profiler but don't know what I'm looking for and where. What is loaded on launch? Any advice on general setup of app that could be causing the delay? Does it load all views associated on the tabbar? Thanks in advance for any help.
Run your program through instruments. Always. All the time. It will tell you most of the problems.
That said, you probably need to delegate your startup tasks to background threads, and update the UI as data comes available.
Use NSOperation, GCD, and related technologies for executing your background tasks.

How to create animated splash screen not with Images in iOS

I want to know that how one should proceed in building animated splash screen.
I already did the animated splash screen with images but here I want to add custom animation like something is drawn on screen etc.
can anyone guide me through this.
simply you need to present a UIViewController which is hold your animations and dismiss it when your app is ready to launch. but also I think its better to follow apple HIG .. as apple describe you should
Supply a launch image to improve user experience.
Avoid using your launch image as an opportunity to provide:
An “application entry experience,” such as a splash screen An About
window Branding elements, unless they are a static part of your
application’s first screen Because users are likely to switch among
applications frequently, you should make every effort to cut launch
time to a minimum, and you should design a launch image that downplays
the experience rather than drawing attention to it.
Generally, design a launch image that is identical to the first screen
of the application.
Exceptions:
Text. The launch image is static, so any text you display in it will
not be localized.
UI elements that might change. Avoid including elements that might
look different when the application finishes launching, so that users
don’t experience a flash between the launch image and the first
application screen.

understanding Launch images iPhone/iPad

As suggested by Apple I have provided a launch image which equals to my home page iOS app.
At the moment I am testing on the iPhone simulator and I wanted to know if the same happens on real devices.
Everything works fine, however when I am in pages other than home page and I exit from application by pressing the button, then when I enter again, the launch images shows for an instant, and then suddenly the last viewed pages appears.
I wonder how can I avoid this "flickering" of pages. I don't know if this is important, but I am using Storyboards.
This is the intended behaviour if you immediately start the app again. See my answer to another Stack Overflow question on a similar matter.
To explain, the Default.png image is used when the OS is unable to take a screen shot of your last view state. Giving the OS a little longer to screen shot the app will prevent the Default.png being used. This is done so that the device does not just show a black screen, followed by your app popping in.
I am not aware of functionality to see if the OS has finished taking a screen shot. If this was possible you could place a UIImageView on top of your last view and do a more subtle fade out one you have control again.