Posts

Post not yet marked as solved
4 Replies
1.2k Views
The way NSTextView is built it's inevitable to use NSTextStorage with TextKit2, however the NSAttributedString uses NSRange vs the TextKit2 family uses NSTextRange for text location, etc. What I struggle with is the relation between these two. I didn't find a convenient translation between these two. Is NSAttributedStrint NSRange length=1 equal to NSTextRange offset 1? I think it's not (at least it's not necessarily true for every NSTextContentManager. So my question is, given a NSTextRange, what is the corresponding NSRange in NSTextContentStorage.attributedString
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.6k Views
I'm trying to implement custom NSTextContentManager and use it with NSTextView, however it seems that NSTextView expect NSTextContentStorage all the time. final class MyTextContentManager: NSTextContentManager { // ... } It's added to layout manager, and NSTextView instance finds it properly: let textContentManager = MyTextContentManager() textContentManager.addTextLayoutManager(textLayoutManager) however, when I use it, I see errors at: [MyTextContentManager textStorage]: unrecognized selector sent to instance 0x600003d84870 the textStorage property is part of NSTextStorageObserving, that is not NSTextContentManager interface. It looks like NSTextView is not ready to work with custom NSTextContentManager. What did I miss?
Posted Last updated
.
Post not yet marked as solved
1 Replies
704 Views
How do I get updates about the file name change from the NSDocument window title? I noticed that despite file being property registered as a file presenter (by default), none of presentedItemDidChange, presentedSubitemDidChange, or presentedItemDidMove is called despite filename updates on the filesystem. the presentedItemURL does update value at some point. My subclass has autosave enabled, which makes title editing possible. override class var autosavesInPlace: Bool { true } [object Object]
Posted Last updated
.
Post not yet marked as solved
7 Replies
3.7k Views
Hi,I'm trying to use CloudKit Web Services to access my public database (development env.) I can read the records, when I try to use enpoint /records/modify I always get response that CREATE operation not permitted{ "records" : [ { "serverErrorCode" : "ACCESS_DENIED", "recordName" : "E99612AE-34A7-482E-876E-BE2F3D063397", "reason" : "CREATE operation not permitted" } ] }I have Web Token obtained as described here (Authenticating Users): https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW1I already did try enable "everything" in "Security" of my "Record Type", didn't help. What should I do to make it work ? help, I'm totally stuck.
Posted Last updated
.
Post marked as solved
1 Replies
1.6k Views
The documentation to NSFileProviderManager.signalEnumerator(for:) says Alerts the system to changes in the specified folder’s content. and headers says: Set the containerItemIdentifier to the identifier of the enumerated container that was specified in -[NSFileProviderExtension enumeratorForContainerItemIdentifier:error:] from that, I understand the parameter is any container identifier that returns valid NSFileProviderEnumerator. I think I tried everything already, and it just doesn't seem to work this way. The only container that seems to work is .workingSet I'm not sure whether it suppose to work with anything else than workingSet container, or I'm missing some important part that makes it happen. Does anyone have a sample that works with eg. rootContainer? help. I'm loosing on this one.
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
What's the purpose of NSFileProviderReplicatedExtension.item(for:request:completionHandler:) call. It seems like it duplicate what the NSFileProviderEnumerator.enumerateItems(for:startingAt:) already returned. I couldn't find where and why this method is called. What happens if it return different types than from the enumerator? Can you please point me to some explanation what is the relation between these two calls?
Posted Last updated
.
Post not yet marked as solved
0 Replies
643 Views
From Data Essentials in SwiftUI - https://developer.apple.com/wwdc20/10040 WWDC session: you can focus on part of your app by having multiple ObservableObject that offer a specific projection onto your data model and are designed to expose just the data that is needed. I struggle to setup bindings between data model and multiple ObservableObjects as a data projection, without make Data Model a dependency. I wonder if anyone can put some light how to make this setup works. Thanks in advance. I put my experiment in this gist - https://gist.github.com/krzyzanowskim/a58a74914397af3379d766597bdbfa76/edit - it's not working, but maybe that's a start for somebody. Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
12 Replies
4.5k Views
Hi,I want to install a symlink inside /usr/local/binI don't use sandbox (hardened runtime only).I tried:NSWorkspace().requestAuthorization(to: .createSymbolicLink) { (auth, error) in let fm = FileManager(authorization: auth!) try fm.createSymbolicLink(at: URL(fileURLWithPath: "/usr/local/bin/foo"), withDestinationURL: URL(fileURLWithPath: appBundlePath + "/Contents/MacOS/Foo")) }it doesn't work though, I always getcom.apple.secinitd.fileoperations: xpc_pipe_routine() returned [5: Input/output error]The file couldn’t be saved.What are my options to install symlink at /usr/local/bin?
Posted Last updated
.