last day (14 days later) » 

13:36
hello
Hello
thank you for your time in advance, I was wondering if you could look at this - NSURL *fileURL = [NSURL fileURLWithPath:filepath];
self.avPlayer = [AVPlayer playerWithURL:fileURL]; with me?
When I run my app it crashes on those 2 lines, and I'm unsure as to why it does so, as the code should work
it gives me an error message - SIGABRT
you will need to look at the stack trace
in the debugger type 'bt' and post the output
hello larme - all welcome here :)
hello
13:40
let me hazard a guess: filepath == nil
Hi. I was just wondering what was going on there. I have two questions: Why is avPlayer declared as an IBOutlet in your code, and what's the value of fileURL, I'm wondering if it's not nil, path may be wrong (escaped characters, not "full").
this is documented in the NSURL class reference
ok one thing at a time
Well, I started on Objective-c 2 days ago
learning the basics, and decided to follow a tutorial
so filepath == nil would suggest the file is not in your app bundle or you are not looking for it correctly
when it bugged i started to try some things myself
@trojanfoe - * thread #1: tid = 0x11b79, 0x0000000107afb0ae libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x0000000107afb0ae libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x0000000107ac2500 libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0x0000000107869ae4 libsystem_c.dylib`__abort + 145
frame #3: 0x0000000107869a53 libsystem_c.dylib`abort + 144
frame #4: 0x00000001072f9051 libc++abi.dylib`abort_message + 257
frame #5: 0x000000010731eac9 libc++abi.dylib`default_terminate_handler() + 267
that's the result of the bt
13:42
find the app bundle on your drive and check the file is in there
the project is on my desktop
and everything is in there
but Xcode will build it into ~/Library. Find out where it is and open it in Finder
i've not moved anything out of said folder, and I'm using the emulator
alright
something like this? ~/Library/Developer/Xcode/DerivedData
yep
you can probably get clue from the build logs
there's no path in the build log for some reason
13:51
expand the "linker" related line and it should show where it's build the app bundle to.
ye i think that i have it
everything is there
had to get there with the terminal as I couldn't get there with the finder
it build it to derivedData
That's because Library is hidden. Use chflags nohidden ~/Library to unhide it.
i've found the files
everything is in a directory called Build
im not really sure then. start by debugging and confirming if filepath == nil and then check you are attempting to find the right file. Also stop using file-related NSBundle methods and use the ones that return NSURL directly.
alright thank you for your help
14:03
The actual app bundle should be in a directory ending with .app though
check more of the build log entries to find out where it is
so it's crashing because it can't find the app bundle?
no because it cannot find the movie file in the app bundle.
ah alright
thank you
if you haven't arranged for the movie file to be copied into the app bundle during the build it will not magically appear there
I figured ^^
I don't usually make apps
I'm more used to making games
and there it builds the 'res' folder with the game
so I don't need to handle the copying in code
thank you :)
14:05
sounds like cocos2d-x?
nah it's a compiler build by 2 teachers of mine
i'm currently in my last yr
and in an internship ^^
anyway theres a copy files build step there somewhere
GameDevelopment class
14:07
add your movie file to it
yeah i'll check it out
thank you :)
ok ttfn

last day (14 days later) »