Saturday, November 21, 2026
HomeiOS Developmentswift - freopen perform doesn't work in actual iOS System

swift – freopen perform doesn’t work in actual iOS System

[ad_1]

I wish to seize logs in iOS gadget and ship it by way of electronic mail. After looking round I used freopen it really works wonderful simulator, however doesn’t work in actual gadget.
Right here is the code

let paths: String = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].absoluteString
let documentsDirectory: String = paths
let fileName: String = "filename.log"
logFilePath = (documentsDirectory as NSString).appendingPathComponent(fileName)
let logFILE = freopen(logFilePath.cString(utilizing: String.Encoding.ascii)!, "a+", stderr) //logFILE is nil in actual gadget

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments