Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Marcos Reboucas
12,890 PointsGetting "track" always nil. What could be?
The value of "track" in my Memo is always nil, so it goes this path:
guard let trackData = memo.track else {
fatalError("Cannot play file without the data")
}
I'm creating "track" like this:
var track: NSData? {
return NSData(contentsOf: fileURL as URL)
}
The fileURL is correct and file exists in disk, but "track" can't be created.
Caleb Kleveter
Treehouse Moderator 37,862 PointsCaleb Kleveter
Treehouse Moderator 37,862 PointsCan you post more information such as the path to the file you are trying to access. Anything else would be helpful.