I'm using NSView.scroll(_:) but then the scrollers flash. Is there a way to scroll without making them flash, like when using UIView.contentOffset?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When evaluating some variables holding an optional value in the debugger with e variable, Xcode prints something like (Bool?) $R3 = nil. This gives the impression that the value is nil (what else should it mean?) and hovering that variable in the code editor also shows a popover with the content nil, but evaluating e variable?.description shows that it holds some value, for example (String?) $R4 = "false" (as a validation, the command e variable == false prints (Bool) $R6 = true.
I submitted a bug report on November 2019, more than 2 years ago, and it never got any response. Is it possible that this is the expected behavior? Why can nobody fix it? I'm constantly wasting time because of this bug that causes me to make wrong assumptions during debugging.
It often happens that after a successful build I do some small changes that cause some compiler errors, but undoing those changes with Cmd-Z still leave the errors there. Building also doesn't remove them. Only cleaning the project and building again (which is very time consuming) or doing a small edit on the line that Xcode still thinks is wrong (such as adding a whitespace and immediately undoing it) finally gives a successful compilation again.
I filed a bug report in September 2018, more than 3 years ago, and never got a response. Can it really be that I'm the only one experiencing this and why does it take so long to fix such annoying bugs and why does nobody care to give some reassurance that somebody is working on this?
First: is there a way of gracefully animating the popover's size to the size of the view controller pushed onto the navigation controller, like Pages does for the three dots menu? When setting the navigation controller's preferredContentSize inside the pushed table view controller's viewWillAppear, first the push animation is run, and when it finishes, the popover is resized.
Second: how to get the correct size to set as preferredContentSize? That would probably be the table view's contentSize (which, unless calling reloadData(), is .zero in viewWillAppear) plus the navigation view's title bar height. How can one calculate this, without having to sum the different parts manually?
It seems that whenever my app goes to the background and is then activated again, the navigation item's titleView's superview is nil, even though the navigation item's titleView property is still set. Is this expected?
In order to support a custom paste behaviour, In my UITextView, which I set as its own UITextPasteDelegate in awakeFromNib(), I implemented textPasteConfigurationSupporting(_:,transform:).
When pressing the paste button above the software keyboard, in the callback of item.itemProvider.loadItem(forTypeIdentifier: UTType.rtf.identifier) I get an error
Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.rtf" UserInfo={NSLocalizedDescription=Cannot load representation of type public.rtf, NSUnderlyingError=0x28374e8e0 {Error Domain=PBErrorDomain Code=13 "Operation not authorized." UserInfo={NSLocalizedDescription=Operation not authorized.}}}
even though the item.itemProvider.registeredTypeIdentifiers are
"iOS rich content paste pasteboard type", "Apple Web Archive pasteboard type", "com.apple.uikit.attributedstring", "com.apple.rtfd", "com.apple.flat-rtfd", "public.utf8-plain-text", "public.rtf", "public.html", "com.apple.WebKit.custom-pasteboard-data"
and item.itemProvider.canLoadObject(ofClass: NSAttributedString.self) returns true.
Even item.itemProvider.loadObject(ofClass: NSAttributedString.self) returns a similar error:
Error Domain=NSItemProviderErrorDomain Code=-1200 "Could not coerce an item to class NSAttributedString" UserInfo={NSLocalizedDescription=Could not coerce an item to class NSAttributedString, NSUnderlyingError=0x283497b70 {Error Domain=PBErrorDomain Code=13 "Operation not authorized." UserInfo={NSLocalizedDescription=Operation not authorized.}}}.
I'm trying to understand why my app produces weird drawings when using Metal instead of OpenGL on an old Mac Pro 2008. The system info says it belongs to macOS GPUFamily1 v3. A 2012 MacBook Pro, for which my app works fine with Metal, belongs to GPUFamily1 macOS 1. Does the first correspond to MTLFeatureSet.macOS_GPUFamily1_v3 and the second one to MTLGPUFamily.mac1 or something else? Would the second one be MTLFeatureSet.macOS_GPUFamily1_v4 or something else?
The only commands I use for drawing are MTLRenderCommandEncoder.setVertexBytes(_:length:index:) , setFragmentTexture(_:index:) and drawPrimitives(type:vertexStart:vertexCount:). I think these are pretty basic commands that should work across all Metal versions, and the documentation doesn't say that they don't work on certain versions.
I noticed that when copying files in the Finder to a FAT32 volume, the modification dates of directories show the current date, but when copying from the same FAT32 volume to my Mac the directory modification dates are preserved. Using the Terminal command
touch -mt 202110251405 path_to_file
where path_to_file points to a directory doesn't seem to work: the modification time stays the same as before. When path_to_file is a regular file, it works. Is this expected, or is there some limitation with FAT32 directories?
My app update won’t be accepted because apparently it contains a bug that causes a crash that I cannot reproduce. The review team uploaded a crash report on App Store Connect on September 27th, 2022, but ever since downloading it was not possible because of an App Store Connect bug. The corresponding Feedback Assistant report is also still open. So my update has now been held in queue for almost 4 months. Can anybody please speed this up? This is unacceptable.
I'm trying to implement a regular expression search in a UITextView with the UITextView.findInteraction introduced in iOS 16. The documentation shows a UIFindInteraction.optionsMenuProvider property and reads
You use this closure to modify, augement or omit options from the default set available in UITextSearchOptions.
But it's not clear how to actually modify the UITextSearchOptions, and where these options are even stored. And how would I omit options? How can the UIActions passed as the only argument to UIFindInteraction.optionsMenuProvider be distinguished from one another?
Is this possible and how? I've only seen examples about using NSMetadataQuery to search directories for files matching some predicate. I tried using this code
let query = NSMetadataQuery()
query.valueListAttributes = [NSMetadataUbiquitousItemPercentDownloadedKey]
query.predicate = NSPredicate(value: true)
let item = NSMetadataItem(url: url)!
query.searchItems = [item]
NotificationCenter.default.addObserver(forName: .NSMetadataQueryDidUpdate, object: query, queue: nil) { notification in
print(notification)
}
NotificationCenter.default.addObserver(forName: .NSMetadataQueryDidFinishGathering, object: query, queue: nil) { notification in
print(notification)
}
query.start()
but this gives the following exception
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unknown kind of NSPredicate given to NSMetadataQuery (TRUEPREDICATE)'
Without any predicate the query doesn't seem to start at all, like mentioned in the official documentation.
I tried to update the UISplitViewController in my old iOS project to use the newer column-based API, but noticed that when setting the Style to Double Column in IB from the currently selected Unspecified (Discouraged), the swipe gesture doesn't show and hide the master view controller anymore, even if the option Presents Primary With Gesture is selected. This also happens with a fresh project where I dragged the standard split view controller into the IB canvas as the initial view controller. Is this expected or am I missing something?
What does this warning mean? In my main app, whenever this warning is logged, the outline view begins to behave weirdly after that, overlapping rows and not responding to clicks anymore. When not using automatic row heights or group rows, the warning doesn't appear anymore.
A sample project can be found here.
An interesting thing is that even if there are no group rows, simply implementing the data source method
func outlineView(_ outlineView: NSOutlineView, isGroupItem item: Any) -> Bool {
return false
}
makes the warning appear.
When Xcode shows a warning to update the project settings, it wants to set the deployment target of every target to RECOMMENDED_MACOSX_DEPLOYMENT_TARGET, which seems to be 10.14.6. Why is this value recommended, when the minimum supported version ist 10.13, which has just been raised from 10.10 with Xcode 14?
SCNBox renders the textures correctly, but SCNCylinder seems to mirror the base and top textures. The following code reproduces the issue (just set the image variable to the name of the image you're using, in this case an image with the number 2 in it):
class GameViewController: NSViewController {
let image = "art.scnassets/image.heic"
override func viewDidLoad() {
super.viewDidLoad()
let scene = SCNScene(named: "art.scnassets/ship.scn")!
let cameraNode = SCNNode()
cameraNode.camera = SCNCamera()
scene.rootNode.addChildNode(cameraNode)
cameraNode.position = SCNVector3(x: 0, y: 3, z: 3)
let scnView = self.view as! SCNView
scnView.scene = scene
let node = SCNNode(geometry: SCNCylinder(radius: 0.5, height: 1))
node.geometry!.materials = [SCNMaterial(), SCNMaterial(), SCNMaterial()]
node.geometry!.materials[1].diffuse.contents = image
node.geometry!.materials[2].diffuse.contents = image
node.position.x = -1
node.runAction(.repeatForever(.rotate(by: 1, around: SCNVector3(x: 1, y: 0, z: 0), duration: 1)))
scene.rootNode.addChildNode(node)
let node2 = SCNNode(geometry: SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0))
node2.geometry!.materials = [SCNMaterial(), SCNMaterial(), SCNMaterial(), SCNMaterial(), SCNMaterial(), SCNMaterial()]
node2.geometry!.materials[4].diffuse.contents = image
node2.geometry!.materials[5].diffuse.contents = image
node2.position.x = 1
node2.runAction(.repeatForever(.rotate(by: 1, around: SCNVector3(x: 1, y: 0, z: 0), duration: 1)))
scene.rootNode.addChildNode(node2)
cameraNode.look(at: SCNVector3(x: 0, y: 0, z: 0))
}
}