问题
I've updated XCode7 and like everyone, i have to amend a part of my code to be compliant with Swift2.
But i have a problem, when i m testing the app on the simulator i have no problem. But when i m trying directly on my real device (Iphone 5S IOS9), a black screen displays just with the level of the battery.
I have tried during 3 days to find something on stackoverflow, but nothing seems working.
This topic seems to be the same problem, but doen't work actually. IOS 7 launch image, displaying black screen on device ONLY
I' ve followed the topic iOS 9 Black Launch Screen but it doesn't bring any correct solution
Any idea, or help will be appreciated.
回答1:
Its worked for me:
You can solve this problem using following steps :
First select root level of project and then go in General tab and Find that below blocks.
By default, in "Launch images Source" it shows "Use assets catalogs", click on it
It will ask you to "Migrate launch images to an asset catalog", simply click on "migrate".
Now, In same block in "Launch Screen file", remove default launch screen xib or storyboard. because we don't need to specify it. Just put blank on there.
Now it shows, "Brand Assets" in *launch Images Source", just click on right side arrow of it and set all your app launch screen assets with specific naming scheme.
Press "alt + cmd + shift + k". It will clean build folder of your application.
Now, build and run your app in device.
回答2:
When your app connects to an Webserver or to a domain with localhost
or non https
means http
, than post below into your info.plist
:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>127.0.0.1</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
This let the app make an exception to use Urls without SSL / https.
来源:https://stackoverflow.com/questions/32830860/black-screen-when-launching-the-app-on-device-since-xcode7-update