I have some code calling this method:
mutating
func
readOffset() UInt64
{
let offset: UInt64
debugLog("readOffset")
switch (self.formatVersion)
{
case .v42:
let offset32: UInt32 = self.reader.get()
offset = UInt64(offset32)
case .v43:
offset = self.reader.get()
}
return offset
}
If I put a breakpoint on the switch statement, Xcode never stops there, and if the debugLog() call is commented out, I can't even step into the function at the call site; it just runs to the next breakpoint in my code, wherever that happens to be.
If I put the breakpoint on debugLog(), it stops at the breakpoint.
If I put breakpoints at the self.reader.get() calls, it stops at those breakpoints AND I can step into it.
This is a unit test targeting macOS, and optimization is -Onone.
Xcode 12.4 (12D4e) on Catalina 10.15.7 (19H524).
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm unable to find any word on when Apple will be requiring new submissions be made with Xcode 13. We've already moved over to it, but still need to know.
I've got some old Objective-C code that up until Xcode 15 was compiling just fine. I recently spent time converting a lot of my project to Swift, which meant putting more stuff in the Bridging Header, but everything was fine. Till today.
In file included from /Users/rmann/Projects/Personal/MyApp/repo/src/objc/MissionList/EventListCell.mm:18:
In file included from /Users/rmann/Library/Developer/Xcode/DerivedData/MyApp-hkqhwvmmxqyxlkdlbpsbletzgerr/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/MyApp-Swift.h:288:
In file included from /Users/rmann/Projects/Personal/MyApp/repo/src/BridgingHeader.h:8:
/Users/rmann/Projects/Personal/MyApp/repo/src/objc/HessianClasses/CWHessianArchiver.h:52:55: error: reference to 'Protocol' is ambiguous
+(void)setClassName:(NSString*)className forProtocol:(Protocol*)aProtocol;
^
note: candidate found by name lookup is 'Protocol'
note: candidate found by name lookup is 'Protocol'
This is code that uses NSProxy and passes it an Objective-C protocol. The build transcript does not show the locations of the alleged declarations. If I use Shift-Command-O and type "Protocol", I get /Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/Protocol.h, which is unexpected, given that I'm running Xcode 15 beta 2. xcode-select -p gives /Applications/Xcode-beta.app/Contents/Developer.
I call this a bug, as it compiles fine in Xcode 14.3, and if it should be an error, it should say why it's ambiguous. FB12434640
Have you noticed that Xcode (15 for sure, I think 14 and earlier, too) has at least two kinds of source editor tabs. Some have the filename in regular text, some have it italicized.
When the name is italicized, selecting another file in the navigator replaces the contents of that tab with that other file. When the filename is regular, a new tab is opened if you select a different file.
When working with multiple related documents, I really dislike, in general, the browser model, wherein a windows contents are replaced by the thing you navigated to. But that's a whole separate rant.
For now, I just want to know how and when Xcode decides to make one tab type or the other, and how can I control the behavior?
My app (AppKit, not SwiftUI) displays a small utility window. I can place it over the menu bar, or in the area beside the notch on my MacBook Pro (when it is a secondary screen), but if the screen goes to sleep and I wake it, macOS has moved the window off the menu bar or down out of the notch area.
Is there any way to indicate a window should never be moved by the OS?
I've got this LSUIElement app (no menu bar/dock icon). It puts up a window in certain circumstances to give the user control, but otherwise just runs in the background.
Today I noticed that with its window frontmost, you can type Command-Q and it will quit.
Is there a way to suppress that? I have explicit controls for quitting the app, but normally the user wants it to run in the background always, and I don't want it to be so easy to accidentally quit.
My app depends on the user granting Accessibility access (Allow this application to control your computer). There’s no formal permissions API (that I know of) for this, it just happens implicitly when I use the API for the first time. I get an error if the user hasn’t granted permission.
If the user grants permission and I'm able to successfully register my CGEventTap (a modifier key event tap), but then later revokes it, key responsiveness goes awry. I don’t get any kind of error to my callback, but I do get tapDisabledByTimeout events periodically. I believe something is causing significant delays (but not preventing) in delivering events to my tap.
Upon receiving this, I'm considering attempting to register another tap as a way to test permission, and disabling the real one if I no longer have permission.
Does anyone have any better ideas?
For Apple: see FB13533901.
I've been working on a Swift PM wrapper for the libtiff library, which I installed on my Mac via Brew. So far so good. But I just tried adding it to my visionOS project. and it complained that it was trying to link against a library built for macOS:
building for 'visionOS-simulator', but linking in dylib (/opt/homebrew/Cellar/libtiff/4.6.0/lib/libtiff.6.dylib) built for 'macOS'
I wish Brew would build universal libraries, but it doesn’t, and they have no interest in doing so. What are my options?
If I build libtiff from sources, it’s still a bit of a pain to build against a different SDK. libtiff has its own Makefile I’d rather not try to edit.
Can I make an xcframework out of it? Can I statically link it into my Swit wrapper library? Do I need to hack together a C build target in my Package and copy the source files over to it?
I'm working on a multi-platform app (macOS and visionOS for now). In these early stages it’s easier to target the Mac, but I started with a visionOS project. One of the things the template creates is a RealityKitContent package dependency.
I can target macOS 14.5 in Xcode, but when it goes to build the RealiityKitContent, I get this error:
error: Building for 'macosx', but '14.0' must be >= '15.0'
[macosx] info: realitytool ["/Applications/Xcode-beta.app/Contents/Developer/usr/bin/realitytool" "compile" "--platform" "macosx" "--deployment-target" "14.0" …
Unfortunately, I'm unwilling to update this machine to macOS 15, as it's too risky. Running macOS 15 in a VM is not possible (Apple Silicon).
This strikes me as a bug, or severe shortcoming, of realitytool. This was introduced with visionOS 1.0, and should be able to target macOS < 15.
It's not really reasonable to use Xcode 15, since soon enough Apple will require I build with Xcode 16 for submission to the App Store.
Is this a bug, or intentional?
I've got a Data of deflate (zlib)-compressed data that decompresses properly using NSData.decompressed(), but does not decompress properly using compression_decode_buffer(). The working code looks like this:
let compressedData = Data(bytesNoCopy: buf.baseAddress!, count: readCount, deallocator: .none)
let dataWithoutHeader = compressedData[2...]
let ucData = try (dataWithoutHeader as NSData).decompressed(using: .zlib) as Data
The non-working code looks like this:
let samples = try [Float](unsafeUninitializedCapacity: sampleCount)
{ buffer, initializedCount in
print("Count: \(initializedCount)")
try compressedData.withUnsafeBytes<UInt8>
{ (inCompressedBytes: UnsafeRawBufferPointer) -> Void in
let destBufferSize = buffer.count * MemoryLayout<Float>.size
let scratchBuffer = UnsafeMutableRawBufferPointer.allocate(byteCount: compression_decode_scratch_buffer_size(COMPRESSION_ZLIB), alignment: MemoryLayout<Int>.alignment)
defer { scratchBuffer.deallocate() }
let decompressedSize = compression_decode_buffer(buffer.baseAddress!, destBufferSize,
inCompressedBytes.baseAddress!, inCompressedBytes.count,
scratchBuffer.baseAddress!, COMPRESSION_ZLIB)
print("Actual decompressed size: \(decompressedSize), destBufferSize: \(destBufferSize)")
}
initializedCount = sampleCount
}
It ends up printing:
Actual decompressed size: 46510, destBufferSize: 1048576
(1048576 is the correct size. What data is returned does not appear to be correct.)
I have tried it both with and without the first two bytes of the compressed data buffer, and with and without providing a scratch buffer.
In Ivory, there are custom menu items in the ShareLink sheet that pops up.
How can I customize my own ShareLink?
Topic:
UI Frameworks
SubTopic:
SwiftUI
AVKit provides the SwiftUI view VideoPlayer, and allows you to add an interactive overlay. But that overlay is normally placed behind the system-provided playback controls.
Is there any way to suppress those controls, without resorting to wrapping AVPlayerView?
I recently started a new app that supports universal links. I noticed an error in the apple-app-site-association (AASA) file and updated it. I used mode=developer in the applinks configuration, and it works well on Simulator, but for the life of me I can't get my device to load the new file, and the CDN hasn't updated in days.
Any suggestions for how to get it to update, or get iOS to load the file directly? mode=developer is supposed to do this, but it simply won't on device.
I've tried touching the file, and I can see its reported HTTP last modification date and eTag have changed.
I've tried deleting and reinstalling the app; I've tried restarting the phone; I've tried clean builds; I've tried changing the applinks: to something else and reinstalling; I've tried installing via TestFlight.
I just downloaded and tried Xcode 13b2 on our iOS project. I've been using b1 with a surprising amount of success, switching to 12.5.1 for builds.
But now 13b2 seems to have an issue. In our AVCapture code, you get handed an AVCapturePhoto, and it has methods that return CF_RETURNS_NOT_RETAINED/Unmanaged. If you try to .takeUnretainedValue() on these, the compiler complains that CGImage has no such method. It appears to be ignoring the Obj-C directive.
I'm also unable to view the generated Swift file for that Obj-C header. I get "Couldn't generate Swift Representation" "Error (from SourceKit): Could not load the stdlib module".
Anyone else run into this? I filed FB9211460 about it.
In this talk , at 12:00, the speaker refers to code associated with this talk. But I can't find it anywhere.
Is it available?