Could not load the “” image referenced from a nib in the bundle with identifier

后端 未结 22 2936
渐次进展
渐次进展 2020-12-01 11:32

when I load my application it shows a warning message that

\"Could not load the \"\" image referenced from a nib in the bundle with identifier \"

22条回答
  •  心在旅途
    2020-12-01 12:19

    For those that are getting this error while developing a cocoapod

    I was trying to use an image from my pod's bundle, thats inside a .xcassets file, in the storyboard. It would show fine in the storyboard but when i ran the app it would crash saying it cant find the resource.

    I changed my podspec to include s.resources as well as s.resource_bundles

    s.resource_bundles = {
      'SDKRes' => ['SDK/Assets/*']
    }
    
    s.resources = ['SDK/Assets/*.{xcassets}']
    

    Then it was able to load the resource properly from the storyboard

提交回复
热议问题