Post not yet marked as solved
Symbol Documentation in Your Source Files -
when I highlight the function name addStrings and use the Option-click, it fails to display anything. When I click on the variable, it does display. Is this a failure of Xcode13 or am I missing something I need to set up in the environment first? Thanks all... (P.S. yep I'm a newbie, so this post might not be in a format desired....). But the doc looks like it should work?
import Foundation
/// addStrings function
///
/// This function concatinates two strings returning the combined single string
///
/// - Parameters:
/// - string1: First String
/// - string2: Second String
/// - Returns: FirstString + SecondString
///
func addStrings ( _ string1: String, _ string2: String) -> String {
let resultString = string1 + string2
return resultString
}
let string1 = "Document Quck Help from Option-click not working? "
let string2 = "Does not display, am I missing something"
let newstring = addStrings(string1, string2)
print(newstring)
I'm using Xcode 12.5.1. When I follow a swift goose tutorial for Outline view and Treeview, I've followed it exactly. It fails with...
2021-09-04 09:32:44.832345-0700 treeview1[21236:868981] Metal API Validation Enabled
2021-09-04 09:32:44.851673-0700 treeview1[21236:868981] MTLIOAccelDevice bad MetalPluginClassName property (null)
2021-09-04 09:32:44.853029-0700 treeview1[21236:868981] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
When I download swift goose's project code from GitHub, it works without any error.... The only thing I can think of is (1) When I set Xcode for a new project using macOS and app, I'm missing something, even though it basically looks all the same. (2) Something I'm missing in my Xcode set up due to the fact I've got the "free" Xcode verses developer? Something linking behind the scene's? Is there a difference?
(1) Hi All, I'm a bit of a newbie to Apple, but have used FreeBSD/Linux so I'm somewhat familiar with it's file systems and access with C, C++, and TclTk. I'm really trying to wrap my head around the "Apple FileManager" but find the documentation difficult without the best of examples. Are there any good books out on Xcode, Apple Foundation usage (FileManager) and the NSFileSystem?, etc? Or how to even read and understand Apple's Developer Documents?
Thanks to Quinn (The Eskimo), for replying on Swift Forum, he suggested I follow up here, and he gave me some good pointers on Docs to read. I believe now the below question is due to attributes of "Sandboxing". Since I knew MacOS was BSD underneath, I'd used a Terminal and created other directories other than just the "recommended". While playing with Xcode, I noticed if I used MacOS, "Command Line" and complile a File enumerator from "let directoryURL = URL(fileURLWithPath: "/Users/me/Documents/MyFolder")" I get it asking do I want to give it permission to view my "MyFolder". If I set up a "MacOS, App, and use the same code it fails and I see no asking permission box come up. **Is there a way to give specific access/Entitlements to folders under /Users/me/folders to the/an Xcode app I'm working on? ** The below "NDUOASV" demo code from Apple is what has led me down this path....
If I drop the folders from Finder into the NDUOASV app, it works.
(2) Does anyone out there have experience with "NavigatingHierarchicalDataUsingOutlineAndSplitViews" in the Apple docs. If so please read the following.
I've been playing with it to try and help understand the Apple File System and usage. I've put in a print("debug", url) in the function func addFileSystemObject(_ url: URL, indexPath: IndexPath) {
In the code, I've located where they load a default example directory for viewing in their app in their file "OutlineViewController.swift". The code is
let appsURLs = FileManager.default.urls(for: .applicationDirectory, in: .localDomainMask) addFileSystemObject(appsURLs[0], indexPath: IndexPath(indexes: [0, 0]))
It does as expected. The file URL is " debug file:///Applications/".
However when I change the directory such as
let docsURLs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) addFileSystemObject(docsURLs[0], indexPath: IndexPath(indexes: [0, 0]))
I would of expected it locating my Documents Directory (which is iClouded) under my user directory.
Instead it creates a directory... "debug print file:///Users/me/Library/Containers/com.example.apple-samplecode.SourceViewMD7FZBNW84/Data/Documents/"
I believe the demo app is sandboxing me correct?
But when I drag and drop a folder from my user documents directory into the app from finder it's "debug result is...
" debug file:///Users/me/Documents/MyFolder/ "
Hi all, I used to be able to view all of the files in the directory "Desktop" from the terminal console. Now it states
ls: Desktop: Operation not permitted? Is there a way to fix or allow this?