Black screen when launching the app on device since XCode7 update

一世执手 提交于 2019-12-23 02:43:12

问题


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 :

  1. First select root level of project and then go in General tab and Find that below blocks.

  2. By default, in "Launch images Source" it shows "Use assets catalogs", click on it

  3. It will ask you to "Migrate launch images to an asset catalog", simply click on "migrate".

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

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

  6. Press "alt + cmd + shift + k". It will clean build folder of your application.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!