I've modified a bit the using a path approach like
let bundleUrl = Bundle.main.privateFrameworksURL!.appendingPathComponent("StaticFramework.framework")
let bundle = Bundle(url: bundleUrl)
so that it works now.
It can be used as a workaround
Post
Replies
Boosts
Views
Activity
I can confirm. Accessing resources doesn't appear to be worked in debug mode on a device.
Also, I tried the code from the Accepted Answer (?). It doesn't read the text file from the framework resources.
in addition to my previous comment
The baseline is partially working for me on Xcode 15.2.
It doesn't appear performance tests with the measure(metrics:block:) method are taking their baseline into account. Also Xcode is not suggesting setting а baseline for such a test.
Tests with the measure(_:) method are working fine.
2 years have passed since this thread was created, the problem still exists(
Using the QLPreviewController could be a workaround. It renders docs properly on the Mac.
one more post about crash when printing on iOS 16
I've also tried to read a large file using the approach above and faced the same issues with memory consumption. My implementation is similar to that one.
autoreleasepool did't solve the issues.
It appears the new async/await API consumes the same large amounts of memory
let reader = try FileHandle(forReadingFrom: url)
for try await line in reader.bytes.lines {
// some code processing `line`
}