Post

Replies

Boosts

Views

Activity

Xcode 14.1: “error: Couldn’t realize type of self”
I recently added Swift to my existing objective-c static library project and encountering issues when debugging Swift code. While in a breakpoint and entering po command to print a variable value I get: error: expression failed to parse: error: Couldn't realize type of self Note the following: The project is an objective-c static library with recently added Swift files. The error appears only when breakpoint is in a Swift file. There is no issues while debugging objective-c file (*.m file). Xcode version is 14.1 Project is using CocoaPods. There are no issues with compilation and runtime. The only issue is with debugging Swift code. When running swift-healthcheck from breakpoint, there are plenty of errors as follow: LoadOneModule() -- Missing Swift module or Clang module found for "Infra", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path. While Infra is the name of my static library. (I couldn't find any helpful instructions explaining how to register swift modules, while I'm not even sure it points to the actual issue). Any suggestions will be highly appreciated.
0
1
1.4k
Nov ’22
Xcode 15.0 Beta: String Catalog is not syncing with code in a Static Library
Seems like a bug on the Xcode 15.0 beta. Steps to reproduce: Create a new empty Static Library project in Xcode (objective-C) Add a String Catalog file Add a dummy function which includes NSString *str = NSLocalizeString(@"test string", @"comment"); Build the project. Result: String Catalog is empty while it should be updated with "test string". I submitted FB12408229 Anyone encountered this? Anyone from Apple can kindly confirm?
0
0
877
Jun ’23
Issues to access Swift code located in ObjC static library
I have an iOS app with the following configuration: My own ObjC static library project - MyStaticLib My own ObjC app target project - MyApp I have both projects in the same Xcode workspace so that MyStaticLib is linked successfully to MyApp Both projects have a mix of ObjC and Swift code successfully working. Currently: MyStaticLib: ObjC code can access Swift code and vice versa MyApp: ObjC code can access Swift code and vice versa ObjC code from MyApp can access ObjC code from MyStaticLib (This is achieved by adding Copy Files in Build Phases at MyStaticLib project settings with the ObjC header files) Objective: Swift code located in MyApp to access Swift code located in MyStaticLib Issues: If I'm trying to call a public Swift function located in MyStaticLib from MyApp, I get Cannot find 'YYY' in scope. If I'm adding import MyStaticLib, I get dozens of Duplicate interface definition for class 'ZZZ' Any idea how to resolve this?
0
0
487
Nov ’23