Could not load the image referenced from a nib in the bundle running on device

后端 未结 30 2129
挽巷
挽巷 2020-12-07 18:24

SplitView[1290:307] Could not load the \"canary04.png\" image referenced from a nib in the bundle with identifier \"xx.co.mycompany.ipad.SplitView\"

30条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 19:03

    I was getting this error too. I will describe my scenario:

    I have a subdirectory "img" which has some png's in it.
    One of these png is "ic_timeprogress_000.png"

    In the storyboard (visual designer) I had an imageView and the image was set to "ic_timeprogress_000.png" (not programatically). The designer showed the imageView correctly:

    imageView in subdirectory

    Although when running the app, the error was thrown.

    So in the storyboard I changed (I insist: not programatically) from "ic_timeprogress_000.png" to "img/ic_timeprogress_000.png", which lead to not showing correctly the image in the designer but showing correctly when running (no error)

    imageView in subdirectory

    Although I alter imageView.image programatically, so this "initial image" isn't ever used.

提交回复
热议问题