Fix code to read in two text files in Swift 4, OSX, when one file name is selected.
$10-30 USD
Zaprt
Objavljeno pred več kot 6 leti
$10-30 USD
Plačilo ob dostavi
I have the following code to read in two text files located in the same directory. It reads in the first file but then says I don't have the permission to read in the second throwing the following error: The file “[login to view URL]” couldn’t be opened because you don’t have permission to view it.
@IBAction func OpenDVAFile(_ sender: Any) {
let dialog = NSOpenPanel();
[login to view URL] = "Choose a .dva or .tsn file";
[login to view URL] = true;
[login to view URL] = false;
[login to view URL] = true;
[login to view URL] = true;
[login to view URL] = false;
[login to view URL] = ["dva", "tsn"];
if ([login to view URL]() == [login to view URL]) {
let result = [login to view URL] // Pathname of the file
if (result != nil) {
do {
// Remove the file extension
let baseFile = result?.deletingPathExtension()
// Open the TSN File
let tsnFileURL = baseFile?.appendingPathExtension("TSN")
let tsnFileString = try String( contentsOf: tsnFileURL!)
// Open the DVA File
let dvaFileURL = baseFile?.appendingPathExtension("DVA")
let dvaFileString = try String( contentsOf: dvaFileURL!)
}
catch {
print( [login to view URL] )
}
}
}
}
Hi Sir
I can do your project perfectly.
I have rich experience in Mobile Development for 8 years.
It is no problem for me.
Relevant Skills and Experience
Mobile Developer
Proposed Milestones
$25 USD - Further
Hi,
I have 5 years experience in iOS application development.
I think i can help you and contribute to successfully build your application.
Thanks.
Relevant Skills and Experience
I have 5 years experience in iOS application development.
Proposed Milestones
$111 USD - bug Fix
While I were checking your code instead of you are reading two different file, you just adding the path extension of same file. Either one case will fail.
Second please check whether the file is not corrupted and able it read it in any other software.
I hope this will help you. If it still not working you can assign this project. I can solve this. I have 7 years of exp in mobile tech and I have been working sift from its version 1.0.
I have completed two apps in Mac cocoa using swift.
I m new to freelance and happy to show my experience if you give me an opportunity.
Happy to work with you.
Hello, Did you check the permission of the file? I think it doesn't have proper read permission. I can fix it in 1 hr. Thanks
Relevant Skills and Experience
Swift, IOS app development
Proposed Milestones
$20 USD - Fix Issue