For an initial launch of Xcode, the GatherProvisioningInputs usually takes 60 seconds for a simple project. Subsequent build is fast though.
But the build process seems got stuck at VeryModule of the MyFramework target, which usually takes 15 seconds.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I get many warnings like this when I build an old project.
I asked AI chatbot which gave me several solutions, the recommended one is:
var hashBag = [String: Int]()
func updateHashBag() async {
var tempHashBag = hashBag // make copy
await withTaskGroup(of: Void.self) { group in
group.addTask {
tempHashBag["key1"] = 1
}
group.addTask {
tempHashBag["key2"] = 2
}
}
hashBag = tempHashBag // copy back?
}
My understanding is that in the task group, the concurrency engine ensures synchronized modifications on the temp copy in multiple tasks. I should not worry about this.
My question is about performance.
What if I want to put a lot of data into the bag? Does the compiler do some kind of magics to optimize low level memory allocations? For example, the temp copy actually is not a real copy, it is a special reference to the original hash bag; it is only grammar glue that I am modifying the copy.
This question is related to this post (of mine).
It seems default build settings do not include dSYM files needed when uploading embedding app package. But now Xcode issues new warnings about this.
Now the question - how do I tell Xcode to create dSYM files for me, say when I build My.Framework?
I asked AI chatbot which tells me that for release build I need to :
set "Debug Information Format" to DWARF
set "Strip Debug Symbols During Copy" to off
I have item 1 turned on (which I believe is the default). But item 2 is on, maybe that's the reason I do not have dSYM files in final built My.Framework.
Should I turn "Strip Debug Symbols During Copy" off?
After upgrading to Xcode 16.3, whenever I open the Documentation window, Xcode started CPU hungry mode, forever.
Does anyone else have the same experience as me? Is there any known remedy so far?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I don't get any idea why I am getting the following warnings when I tried to upload one of my apps:
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store
App Submission
Dare anyone try the following code in any Playground:
// Define a model that conforms to Codable
struct User: Codable {
var name: String
var age: Int
var email: String?
}
// JSON data (as a string for demonstration)
let jsonString = """
{
"name": "John Doe",
"age": 30,
"email": "john@example.com"
}
"""
// Convert the JSON string to Data
if let jsonData = jsonString.data(using: .utf8) {
do {
// Parse the JSON data into the User model
let user = try JSONDecoder().decode(User.self, from: jsonData)
print("Name: \(user.name), Age: \(user.age), Email: \(user.email ?? "N/A")")
} catch {
print("Error decoding JSON: \(error)")
}
}
I tested with Xcode 16.2 and latest 16.3, it reliably crashes the lldb server!
The following code won't work:
- (void)windowDidLoad {
[super windowDidLoad];
self.window.isVisible = NO;
}
The only main window still shows on application startup (in a minimal newly created app).
One of my published apps in App Store relies on this behavior which had been working for many years since I started Xcode development.
Topic:
UI Frameworks
SubTopic:
AppKit
I tried \s+$ to find trailing spaces, but it seems the IDE code editor behaves strangely - it locates random lines that obviously has no trailing spaces.
Did I misunderstand regex in the editor?
I believe starting from version 15, Developer Documentation is broken in several ways (at least for me).
Quick Help pane shows meaningless header information about many classes:
Reveal in Navigator does not work in most cases:
For example stringWithFormat:
I have a weird problem with Xcode v15.4.
For some unknown reasons, it sometimes becomes a zombie process - I cannot even quit it using CMD+Q, nor can I close open projects. I have to forcibly kill the process using Activity Monitor.
The problem will mostly strike after a long time of idle time (hours or even days).
Does anyone else have this same problem? Is there known workaround?
BTW, when it becomes a zombie process, another related com.apple.dt.SKAgent process will begin consuming much CPU time forever.
I want to implement a stack that works quite like a circular buffer.
void** pp = malloc(sizeof(id) * 100);
pp[index] = someObject;
// later on somewhere:
MyObject* myObj = (MyObject*)pp[index];
Is this correct? Does this approach work with ARC?
I came across a useful repo on GitHub:
https://github.com/GianniCarlo/DirectoryWatcher/blob/master/Sources/DirectoryWatcher/DirectoryWatcher.swift
self.queue = DispatchQueue.global()
self.source = DispatchSource.makeFileSystemObjectSource(fileDescriptor: descriptor, eventMask: .write, queue: self.queue)
self.source?.setEventHandler {
[weak self] in
self?.directoryDidChange()
}
self.source?.setCancelHandler() {
close(descriptor)
}
self.source?.resume()
How do I translate this to OC version? I have an app that was written in OC and I plan to incorporate this directory watcher into the project.
It's quite annoying (maybe it's only my personal interests). Some apps or the macOS system always create ~/Applications/asr directory and create some txt files in it.
asr20240708_1638030_0.txt
{"type":"asr","wp_version":"","easr_version":"e792c1d2b4b5055e56fb902dfefdb483802041cc_Thu_Dec_30_17:18:43_2021_+0800","spil_version":"","wpe_version":"","vad_version":"9db42b766a4bc4e853bfa3fd2f846bf931d6c05f_Wed_Mar_24_15:56:16_2021_+0800","header_type":0}
It there any way to disable this 'useful' feature?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I can't believe this. I am not able to remove the following garbage items:
Right clicking does not provide any menu items to remove the garbage items.
It seems I can declare variables like below in a source file:
private let var1 = 1234
fileprivate let var2 = "abcd"
class MyClass {
// ...
}
So what's the difference between the 2 vars here?