Skip to content

Commit

Permalink
[fix] "[NSURL length]: unrecognized selector sent to instance…"
Browse files Browse the repository at this point in the history
Trying to remove a file using FileManager.removeItem:at. The URL is an assets-library and something internally is invoking `length` maybe assuming it’s a NSString/CFStringRef 🤨
  • Loading branch information
ricardopereira committed Jan 24, 2019
1 parent 6e47513 commit 6e738ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sodes/SodesFoundation/FileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public extension FileManager {

public func removeDirectory(_ directory: URL) -> Bool {
do {
try removeItem(at: directory)
try removeItem(atPath: directory.absoluteString)
}
catch {
return false
Expand All @@ -57,7 +57,7 @@ public extension FileManager {

public func removeFile(at url: URL) -> Bool {
do {
try removeItem(at: url)
try removeItem(atPath: url.absoluteString)
}
catch {
return false
Expand Down

0 comments on commit 6e738ed

Please sign in to comment.