568 questions
0 votes
1 answer
37 views
How do I handle duplicated symbols in a loadable NSBundle/plug-in?
Consider the following Cocoa project structure: Host |-- LoadablePlugIn | |-- Main.storyboard | |-- Info.plist | |-- TDWLPIClassOne.h | |-- TDWLPIClassOne.m | |-- TDWLPIClassTwo.h | |-- ...
1 vote
0 answers
99 views
How to get localized name of NSBundle*
I try to get the localized name of an app on MacOS. static void printBundleInfo(NSBundle *bundle) { auto printNSString = [](NSString *s){ INFO << QString::fromNSString(s); }; INFO << &...
0 votes
1 answer
2k views
Check existence of localized string in .strings resource file, fall back to default
I want to find the appropriate localized string based on some runtime variable and fall back to a default string: // localizable.strings "com.myapp.text1" = "The default text 1&...
0 votes
1 answer
852 views
Image from bundle loads ok in SwiftUI but not in UIKit
I have developed a framework that consists of some colors in the asset catalogue. I packaged it in the cocoapod and integrated in another project where I try to access the assets from the framework. ...
1 vote
1 answer
59 views
Cocoa get current running path of SIMBL Plugin
I am working on a SIMBL Plugin that is loaded by a 3rd-party host application on macOS. It is almost entirely written in C++ and has only minimal objective-c components. (The UI is largely provided by ...
4 votes
1 answer
257 views
No "kCFBundleVersionKey" sometimes: all possible scenarios?
I have a code like this in my app: NSString* version = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; In most cases it works, and returns the Bundle version, but ...
0 votes
0 answers
232 views
What is the difference between NSBundle bundleWithURL URLforResource and NSBundle mainBundle PathforResource
I have the following code. NSString *path = [[NSBundle mainBundle] pathForResource:@"play" ofType:@"mp3"]; The code above gets from mainBundle (Application Bundle) a file play.mp3 ...
2 votes
1 answer
2k views
How to find all available Strings-Tables in iOS project?
Is it possible to find all localization tables which are available in a iOS Project? Background: In a Swift based iOS project I am using multiple, localized .strings files. For example one file ...
1 vote
0 answers
158 views
NSBundle PathsForResources returning null after downloading On Demand Resource Bundle
My team is experiencing a very odd issue with Apple's On Demand Resources framework. It's a randomly occurring problem where a user will successfully download one of our resources yet when we try to ...
-1 votes
1 answer
330 views
Thread 1: "Could not load NIB in bundle: 'NSBundle (loaded)' with name 'SleepThreeCollectionViewCell'"
I am receiving this error and I checked every answer there is online on how to solve this and it does not work for me. I tried cleaning the build folder, I do not have a xib file, reuploading the ...
0 votes
1 answer
2k views
How can I check if Bundle.module is defined?
In my iOS app I am using SPM to manage dependencies. One of them is a library that loads resources with Bundle.module (a new feature available in Swift 5.3). But now I need to use CocoaPods for my app....
1 vote
0 answers
148 views
Override internal symbol in different modules in Swift
I have a project comprising multiple frameworks, a couple of which need to initialize UIImage instances. UIImage's initializer defaults to using Bundle.main if you don't specify a Bundle. This means ...
1 vote
1 answer
58 views
How can I check the values of NSLocalizedString in multiple locales?
Our iOS app is translated into 19 languages, and recently I found an issue where two buttons on a screen had the same title - which mean that users couldn't tell which to press! I want to write a unit ...
1 vote
1 answer
672 views
Objective C, Copy resource file from main bundle to documents: Error Domain=NSCocoaErrorDomain Code=4 The file doesn’t exist."
Here I want to achieve a function which can copy a res file from main bundle (which is added manually from Mac Finder to Xcode project ) (Fig 1) to Document Folder. Click here to see the Xcode project ...
0 votes
1 answer
96 views
How do you access a file from inside an app directory
When using NSBundle, is there a macro such as $(APP_BUNDLE) or something similar, so that I can use a specific file?