Post

Replies

Boosts

Views

Activity

Reply to Creating file bookmarks doesn't work anymore on macOS 15 Sequoia
[quote='806001022, Macho Man Randy Savage, /thread/764435?answerId=806001022#806001022, /profile/Macho+Man+Randy+Savage'] Just to throw some spaghetti at the wall, is it possible this could be related to not balancing -startAccessingSecurityScopedResource calls with -stopAccessingSecurityScopedResource when you are done with the file? [/quote] I don't think so. This happened both with my App Store published app and with a sample app I had just created to reproduce the issue. Even after restarting both apps they had the same issue. It only disappeared the day after.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’24
Reply to SKTexture initialized with system UIImage has slightly wrong aspect ratio and ignores system symbol color
[quote='803865022, endecotp, /thread/763479?answerId=803865022#803865022, /profile/endecotp'] In principle you could render the UIImage into a graphics context and then create your SKTexture from that. [/quote] That's a great idea. I changed the iOS code to this and it seems to work for both aspect ratio and color: var image = UIImage(systemName: systemImage)!.applyingSymbolConfiguration(.init(pointSize: width))!.applyingSymbolConfiguration(.init(hierarchicalColor: .white))! image = UIGraphicsImageRenderer(size: image.size).image { context in image.draw(at: .zero) }
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Sep ’24
Reply to SKTexture initialized with system UIImage has slightly wrong aspect ratio and ignores system symbol color
[quote='803792022, endecotp, /thread/763479?answerId=803792022#803792022, /profile/endecotp'] UIImage and CGImage have different aspect ratios for SF Symbols, due to padding. [/quote] I tried using SKTexture(image: image) and SKTexture(cgImage: image.cgImage!) and they both produce the same result. Do you think this is expected or do you have a suggestion for how one could do it differently?
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Sep ’24
Reply to SKTexture renders SF Symbols image always black
Same issue here. Not only is the image on iOS always black when on macOS it displays as expected, but on iOS some images are also displayed with a slightly wrong aspect ratio, as demonstrated by this code: import SpriteKit #if os(macOS) import AppKit #else import UIKit #endif class GameScene: SKScene { override func didMove(to view: SKView) { let systemImage = "square.and.arrow.up" let width = 400.0 #if os(macOS) let image = NSImage(systemSymbolName: systemImage, accessibilityDescription: nil)!.withSymbolConfiguration(.init(hierarchicalColor: .white))! let scale = NSScreen.main!.backingScaleFactor image.size = CGSize(width: width * scale, height: width / image.size.width * image.size.height * scale) #else let image = UIImage(systemName: systemImage)!.applyingSymbolConfiguration(.init(pointSize: width))!.applyingSymbolConfiguration(.init(hierarchicalColor: .white))! #endif let texture = SKTexture(image: image) print(image.size, texture.size(), image.size.width / image.size.height) let size = CGSize(width: width, height: width / image.size.width * image.size.height) addChild(SKSpriteNode(texture: texture, size: size)) } }
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Sep ’24
Reply to SceneKit app randomly crashes with EXC_BAD_ACCESS in jet_context::set_fragment_texture
[quote='802657022, deeje, /thread/763173?answerId=802657022#802657022, /profile/deeje'] FWIW, early in my SceneKit days, I experienced similar crashes, and solved it by refactoring my code to add and remove SCNNodes only in main thread. [/quote] Thanks for the suggestion, but I already solved these kind of crashes a long time ago. I'm already doing scene changes on the main thread.
Topic: Graphics & Games SubTopic: SceneKit Tags:
Sep ’24
Reply to Xcode downloads client crash report but the stacktraces don't contain any of my app's symbols
[quote='802429022, DTS Engineer, /thread/762421?answerId=802429022#802429022'] You mention AppKit above, but also iOS, so I'm unclear on what your app's target platform is. [/quote] Sorry for the confusion. It's a macOS app. I just thought the contents of the bridging header could be meaningful, and I wanted to explain why I'm redeclaring enum vtype even if it's available on macOS (it's because it's not available on iOS, even though getattrlistbulk is, so in order to have the macOS and iOS versions as similar as possible I declare that for both targets).
Sep ’24
Reply to Xcode downloads client crash report but the stacktraces don't contain any of my app's symbols
[quote='802017022, DTS Engineer, /thread/762421?answerId=802017022#802017022'] any C++ code running within your process could cause the above [/quote] Do you mean that such code would have to be in its own .cpp file, or would it be sufficient to call it from a .swift file? Apart from the bridging header, my project only contains Swift files. This crash only seems to be happening to a couple users and it never happened to me, so I don't think I would be luckier trying to reproduce it on a smaller tester app. I guess I'll never find out unless macOS or Swift (I'm not sure which one is responsible here) shows more meaningful exceptions.
Aug ’24
Reply to Xcode downloads client crash report but the stacktraces don't contain any of my app's symbols
Thanks. Does that mean that C++ code caused the crash? My app is written in pure Swift with a bridging header that only defines these constants needed for accessing the results of getattrlistbulk on iOS: enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD, VSTR, VCPLX }; When causing a crash on the main thread with the following code @main class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application DispatchQueue.main.async { fatalError() } } } I get this stacktrace in the crash report: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x1a06b906c _assertionFailure(_:_:file:line:flags:) + 592 1 problem2 0x100d1a8e4 closure #1 in AppDelegate.applicationDidFinishLaunching(_:) + 68 (AppDelegate.swift:19) 2 problem2 0x100d1a904 thunk for @escaping @callee_guaranteed () -> () + 28 3 libdispatch.dylib 0x1907fb750 _dispatch_call_block_and_release + 32 4 libdispatch.dylib 0x1907fd3e8 _dispatch_client_callout + 20 5 libdispatch.dylib 0x19080bbb8 _dispatch_main_queue_drain + 988 6 libdispatch.dylib 0x19080b7cc _dispatch_main_queue_callback_4CF + 44 7 CoreFoundation 0x190acead4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 8 CoreFoundation 0x190a8c258 __CFRunLoopRun + 1996 9 CoreFoundation 0x190a8b434 CFRunLoopRunSpecific + 608 10 HIToolbox 0x19b23519c RunCurrentEventLoopInMode + 292 11 HIToolbox 0x19b234e2c ReceiveNextEventCommon + 220 12 HIToolbox 0x19b234d30 _BlockUntilNextEventMatchingListInModeWithFilter + 76 13 AppKit 0x1942eacc8 _DPSNextEvent + 660 14 AppKit 0x194ae14d0 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700 15 AppKit 0x1942ddffc -[NSApplication run] + 476 16 AppKit 0x1942b5240 NSApplicationMain + 880 17 problem2 0x100d1aacc specialized static NSApplicationDelegate.main() + 24 [inlined] 18 problem2 0x100d1aacc static AppDelegate.$main() + 24 (<compiler-generated>:10) [inlined] 19 problem2 0x100d1aacc main + 36 20 dyld 0x190623154 start + 2476 Or where you hinting at something different?
Aug ’24