Post

Replies

Boosts

Views

Activity

Reply to Is it possible to develop USB drivers for third-party camera devices ?
Thanks, I'll try that - however I suspect the device is not USB UVC compliant. It's a Nikon Z6 and I guess it will need a vendor specific driver much like the recently announced Cannon USB webcam utility. Nevertheless I'll run IORegistryExplorer as suggested above. There is some third-party software that seems to work with the specific Z6 camera - how is it they are able to access the video stream from the camera via USB without using a vendor specific driver ? Is there some other way to access the device directly from within an application ? Regards
Jun ’20
Reply to Why do I get an error when deleting data from SwiftUI List and Realm?
You can't use Realm Collections with SwiftUI (or other reactive languages). The basic issue is because when you delete the realm object the object is marked as invalid and any attempt to access it's properties throws an exception - pretty brutal huh !! No quiet - sorry this is not allowed ! The way SwiftUI works is is keeps track of the list of items and when the list changes it gets notified that something changes and then it diffs the new list with the old list and neatly adds or removes items as required. Herein lies the problem - it still has a reference to the now deleted object in realm and attempts to access its properties causing an exception - OR - in your case it is checking the OLD list, which is actually a live updating REALM collection, which already has the item removed - and hence the index out of bounds error. Check out the new frozen() option and the same in the 5.2.0 SwiftRealm release - not sure if that completely fixes the issue, but lets hope so !
Jul ’20
Reply to Using Metal for Photo Editing
OK well I solved this after much searching - it's a long story that involves using CAMetalLayer and the correct CIFilter pipeline as well as coordination with view resizing or scrolling but the end results is a realtime view of the effects of changing parameters on CIFilters. Basically a recreation of Photo's and Lightroom functionality with ability to view thousands of thumbnails, smooth scrolling and RAW editing. It can be done ... and it seems I can't include a URL to the result in this post!
Jul ’20
Reply to Why are CATiledLayers drawing on a single thread in 10.14 and 10.15?
This might have nothing to do with your issue but we experienced the same problem with our background reporting threads where they suddenly took forever to run. We solved that by setting the thread or queue priority to be user interactive (or something like that). Sorry I don't have the details in front of me. I have no idea if you can do the same with the drawing threads for CATiledLayer - or whether this the issue but thought it was worth mentioning. Let us know if you find the solution.
Feb ’21
Reply to How do I implement NSAttributedStringValueTransformer for attributed strings stored in Core Data
Thanks, I figured that it might be a bug and have submitted a report via FeedbackAssistant (#FB9079551) and raised a DTI where they told me you had responded here :-) Yes I have existing application with existing archives. Note that the attachments are PDF documents or images the user may have pasted in to the text view. Not sure whether it would be possible to convert the file attachments to data without loosing some file details but I suspect so. Anyway thanks for the great response. I don't think I have ever had a useful response from anyone from Apple on these forums before - great to see such good support these days. ***** (that's 5 stars!) Regards
Apr ’21
Reply to Granting full-disk access to my sandboxed app not working
Hi Eskimo can you indicate whether it is possible for a Sandboxed macOS app to retain permission to files for future access. For example the user selects a folder initially and the app reads metadata from the files in the folder and keeps a database of the files. At some future point the user launches the app again and selects a database record and the app then loads that file. Currently in in subsequent file access for generating thumbnails we get the following error. error: Error Domain=NSPOSIXErrorDomain Code=1 "couldn't issue sandbox extension com.apple.app-sandbox.read for '/Volumes/Network_Drive/Documents/samples/XXXX.***': Operation not permitted" Is there some way for the app too retain the directory permissions so that future file reads at permitted. Thanks
Apr ’21
Reply to What is the correct way to get a RAW files image size
It seems that the RAW file contains the native camera image size (sensor size) and the thumbnail contains and image that is set to the aspect ration setting that was used on the camera. So when querying the RAW files thumbnail you get the thumbnail stored by the camera but when getting the CIImage using CIFilter you get the full image i.e. native camera sensor image size. There seems to be no RAW API to get the camera set aspect ratio but this data does seem to exist in the EXIF data XDimension and YDimension.
May ’21
Reply to Help debugging Thread 1: EXC_BAD_ACCESS (code=1, address=0x28) crash
With a bit more fiddling around I get this [error] precondition failure: invalid attribute id: 2189977 AttributeGraph precondition failure: invalid attribute id: 2189977. And finding similar errors elsewhere I remembered that I changed a NavigationView to a HSplitView (?) which seems to behave the same . After reverting to NavigationView this crash goes away ! Is this a bug? and should I raise a bug with Apple for this ?
May ’21
Reply to How can I get CALayer to render sublayers correctly when generating PDF ?
This is what I ended up doing - should this really be necessary ? class ZOrderDrawingLayer: CALayer {     override func render(in ctx: CGContext) {         if let layers:[CALayer] = self.sublayers {             let orderedLayers = layers.sorted(by: {                 $0.zPosition $1.zPosition             })             for v in orderedLayers {                 ctx.saveGState()                 let w = v.bounds.width/2                 let ww = w*w                 let h = v.bounds.height/2                 let hh = h*h                 let c = sqrt(ww + hh)                 let theta = asin(h/c)                   let angle = atan2(v.transform.m12, v.transform.m11)                 let x = c * cos(theta+angle)                 let y = c * sin(theta+angle)                 ctx.translateBy(x: v.position.x-x, y: v.position.y-y)                 ctx.rotate(by: angle)                 v.render(in: ctx)                 ctx.restoreGState()             }         }     } }
May ’21
Reply to macOS multiple document app, multiple CoreData stores
Not sure I understand how this works. DocumentGroup provides the ability to browse/create/select a file but how do you create a new core data file or save one where there have been edits made. I don't see how you set the path to the actual file that is created/selected in DocumentGroup. Perhaps I am misunderstanding something but don't you need to create the sqlite or binary core data file at the URL obtained/created by DocumentGroup ? Otherwise doesn't NSPersistentContainer just store the core data files in the apps default location. I am assuming use of DocumentGroup means you can create the core data file on anywhere on iCloud Drive. var body: some Scene {         DocumentGroup(newDocument: { Document() }) { config in             ContentView()             // injecting persistent controller into the document view                 .environment(\.managedObjectContext, config.document.persistenceController.container                                 .viewContext)         }     }
Dec ’21