I'm trying to run a program that displays videos, but where should I put them?

Asked 2 years ago, Updated 2 years ago, 74 views

I am a beginner in iOS app development.

I am trying to move the sample to display the video using Xcode and Objective-C, but the video is not displayed.
The code for the pass part of the video is

NSString* path=[NSBundle mainBundle] pathForResource:@"sample" ofType:@"move"];

appears.

The description says "read from resource", but I'm not sure what this resource refers to.
I tried putting the video in the same hierarchy as the xcodeproj file and putting it in the folder where the source file is, but it didn't show up.Where should I put the video?

I'm sorry for the rudimentary question, but I can't find any information about this, so please let me know if you don't mind.

objective-c xcode

2022-09-30 16:59

1 Answers

The description says Import from Resources, but I'm not sure what this resource means.

Resources are components of applications other than program code (not limited to applications, but also for plug-ins and enhancements).
Image and audio files, icon data, Storyboard and XIB files are also resources.
Adding resource files to a project is easy.Drag and drop from the Finder window to Project Navigator in Xcode.
(Going directly to the project folder on Finder does not recognize that Xcode and the project have been added.)

Enter a description of the image here

Xcode copies the resources added to the project into the app package when it is built, so the programmer does not work directly.

When adding resources, you should be careful to see if they are enabled.

Enter a description of the image here

When adding resources, the above dialog will appear, but if the red line is not checked, it will not be enabled and Xcode will warn you after the build that it cannot be found. (This may be a case of switching between video candidate A and video candidate B.)


2022-09-30 16:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.