Can't find URL from files using Bundle main url

  • Click at one of your wav files
  • At the right side, there will be a list of options
  • The last option of this list is a tab called Target Membership
  • Check if this wav file you chose marks your current project as target

hope that helps :)


Daniel's answer is right in this case. However this message can also occur because the code is in a framework bundle that is part of the project's workspace. In this case, Bundle.main will get you the main project bundle and you should instead use a different bundle constructor, such as Bundle(identifier: <id>) or Bundle(for: type(of: <object>)) (where object is a class appearing in the bundle you want to load from).

Tags:

Ios

Xcode

Bundle