Post

Replies

Boosts

Views

Created

User voice: Apple geniuses, please pay attention to small details!!!
This is really disgusting. I really hate to say this. I started Xcode programming many years ago when it's at version 4 (or even 3). It has been fun and pleasure to program in this IDE, with no problem at all. User rating of this app in App Store was 4.5+. But 2 or 3 years ago, maybe starting from Xcode 11, it started getting too many quirks/gotchas. App Store user rating drops to 3.5+. With version 14+, user rating drops to 2.9. The app's key/main features work. But many small bugs/nuisances put developers like me into peril during daily coding work. Now I almost want to quit Xcode programming, because it is making my life unpleasant.
1
0
416
May ’23
libarclite_macosx not found when building a framework project
Not sure if it's specific to me only. I tried to build a framework project using Xcode 14.3.1 RC but got a strange error: File not found: /Users/USERNAME/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a The project was created several years ago and was upgraded all the way to Xcode 14.2. I remember last time I posted a question about getting an empty xcarchive when doing archive build. The remedy is quite simple - setting SKIP_INSTALL to no. I wonder if this problem also has a simple remedy.
1
0
2.4k
May ’23
Weird: let statement leads to nil
I have not touched Swift code for more than a year. My skills become rusty. I am not sure what stupid errors I made in the following code: extension Bundle { func readResourceFile(_ filename: String) -> String? { if let fileUrl = self.resourceURL?.appendingPathComponent(filename, isDirectory: false) { return try? String(contentsOf: fileUrl) } return nil } } class MyVC { //... @IBAction func testButton_click(_ sender: Any) { Task.init { await self.test1() } } func test1() async { var loaded = false do { let result = try await self.webView.evaluateJavaScript("typeof(jQuery)") loaded = result as? String == "function" } catch { self.statusLabel.stringValue = "error: \(error)" } if (loaded) { await self.runUserScript(self.input.string) return } let scriptFiles = ["jQuery.js", "Scriptlets.js"] var count = 0 for scriptFile in scriptFiles { print("Loading \(scriptFile)") do { if let script = Bundle.main.readResourceFile(scriptFile) { try await self.webView.evaluateJavaScript(script) print("Loaded \(scriptFile)") count += 1 } } catch { self.statusLabel.stringValue = "error: \(error)" } } } The line if let script = Bundle.main.readResourceFile(scriptFile) { succeeds but script still is nil and causes app crash in next line self.webView.evaluateJavaScript(script). Bundle.main.readResourceFile(scriptFile) is working if I run this line elsewhere. EDIT: When I click on the I button in debugging on variable script I get: (String) script = <no location, value may have been optimized out> However, I can print(script) and the output is correct.
2
0
549
Apr ’23
How to write a wrapper around CFSomeRef
I am testing with FSEventStreamCreate which returns an FSEventStreamRef, but I cannot find an equivalent toll-free class in Cocoa. In order to free-up resources used by this Ref, I need to do following: FSEventStreamStop(stream); FSEventStreamInvalidate(stream); FSEventStreamRelease(stream); That is quite error-prone and tedious. So I want to write a wrapper class, but don't have any idea on when or where to release the Ref. Is it correct to do 'free' in dealloc?
1
0
1k
Apr ’23
Generated xcarchive has no built dylib
I am in peril. Can anyone save me. I am desperate! I am using Xcode Version 14.2 (14C18). I created a fresh new library project (plain C/C++) and added the well-known SQLite3.h and SQLite3.c. When I build debug configuration, Xcode correctly produces dylib. But when I do archive build, the generated xcarchive is almost empty - it does not have expected libsqlite3s.dylib! I even went back to Xcode 7.2.1 on macOS 10.10. Xcode 7.2.1 can correctly produce archived dylib and I can link the dylib with a test app. I am extremely frustrated!
1
0
743
Apr ’23
How stop Xcode from autogenerating application entitlement for dylib?
I am in peril. Can anyone save me. I am desperate! I am using Xcode Version 14.2 (14C18) to build my 2 dylibs. I had no problems with older versions of Xcode (one and half a year ago). But it's causing code signing problems and Connect fails my submitted binary package complaining I had wrong entitlement on dylibs. I contact Apple technical support and I got a reply: Entitlements are only effective on a main executable. When you sign a shared library with entitlement then, at best, the system ignores them. However, in some cases you can run into mysterious problems like this one. The key problem is that Xcode is autogenerating entitlement file for my dylibs. I have no entitlement files in my projects, I am sure. codesign -d --ent - libsqlite3s.dylib Executable=/Users/USERNAME/Library/Developer/Xcode/DerivedData/libsqlite3s-ahztenmeyvsijneqjzdtifjhljlr/Build/Products/Debug/libsqlite3s.dylib [Dict] [Key] com.apple.application-identifier [Value] [String] TEAMID.net.neolib.libsqlite3s How can I turn off this 'useful' feature?
1
0
643
Apr ’23
@available question (again)
I once posted a question in the forums, but it seems I cannot find the thread now (maybe the thread was before the new forums was born). I don't know why I am so confused about this directive (or whatever): It looks like a compiler directive because it has a specific syntax. But it also looks like it's a runtime check because it is used in if statement (not in #if). So my question is: Given the following code: if (@available(macOS 13.0, *) { NSLog("Running on macOS Ventura or later") } else { NSLog("Running on older version before Ventura") } Does this directive check real macOS version during runtime?
1
0
585
Apr ’23
CFBundleIdentifier not match?
I submitted a test package and got the following email: ITMS-90345: Metadata/Info.plist Mismatch - The value for bundle_identifier in the metadata.xml file does not match the value for CFBundleIdentifier in test [net.neolib.test.pkg/Payload/test.app]. I really don't have any idea what's wrong. It's a simple (almost blank) app with nearly no modification (except linked with a dylib). What is the metadata.xml? I cannot find it in my test project.
2
0
839
Apr ’23
No Info.plist in newly created project
It seem Apple is forcing developers to use new Xcode 14.3 and Ventura. I am having various rudimentary problems with Xcode 14.2. Today I created a new project and was surprised to find out that there is Info.plist in the project. I have to copy one from an older project. I am wondering if Xcode 14.3 does the same thing (not creating Info.plist). Or I am quite behind the trend because I had not updated my apps for more than a year. EDIT: Why PRODUCT_BUNDLE_IDENTIFIER is invalid?
2
0
25k
Apr ’23
IB_DESIGNABLE and dylib problem
My app has 2 dylibs linked, in build settings run path is set to "@executable_path/../Frameworks" and a copy file rule is also there. The app runs fine for years now (in App Store). But once I turn on IB_DESIGNABLE for a custom view, IB reports errors like below: It seems IB tries to load the dylibs from somewhere in Xcode.app. What should I do in order to get IB_DESIGNABLE to work in IB?
2
0
717
Apr ’23
Entitlements/signature problem with app submission
I really need help. Can anyone decrypt the following message for me: Dear Developer, We identified one or more issues with a recent delivery for your app, "MYAPP" 2.0 (1200). Please correct the following issues, then upload again. ITMS-90288: Invalid Code Signing Entitlements - The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '' for the key 'com.apple.application-identifier' in 'MYAPP.app/Contents/Frameworks/libsqlite3s.dylib' ITMS-90286: Invalid Code Signing Entitlements - Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, value '' for key 'com.apple.application-identifier' in 'MYAPP.app/Contents/Frameworks/libsqlite3s.dylib' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier . The 2 dylibs are built by myself and for years I did not have this problem with submission. What should I do? Although I know something is wrong with entitlements/signature, but I have no clue at all on what I need to exactly.
1
1
1k
Apr ’23