Reason: '-[NSBundle spld]: unrecognized selector sent to instance
Context:
Sequoia 15.3.1 XCode 16.2 Target: iOS 16 pro Simulator What I've Done:
followed the setup for Inject up to here, including installing the latest InjectionIII via github (edit: latest official release - 5.1.0) adding necessary code below somewhere to be executed on startup
NSBundle *injectionBundle = [NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle"]; [injectionBundle load];
When starting the app, I ran into a exception
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSBundle spld]: unrecognized selector sent to instance 0x600002483e80' *** First throw call stack: 0 CoreFoundation 0x0000000137377569 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00000001338ee116 objc_exception_throw + 62 2 CoreFoundation 0x000000013738d06e +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3 CoreFoundation 0x000000013737becc forwarding + 1459 4 CoreFoundation 0x000000013737e288 _CF_forwarding_prep_0 + 120 5 MyApp 0x0000000104f77275 -[AppDelegate application:didFinishLaunchingWithOptions:] + 437
It's very strange. Why is there this call - [NSBundle spld]?
Then, I replaced the code with the following. And I didn't encounter the above-mentioned problem.
NSBundle *injectionBundle = [NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle"]; [injectionBundle loadAndReturnError:nil];
After entering the app, the console prints as follows.
💉 InjectionIII connected .../MyApp/MyApp.xcodeproj 💉 Watching files under the directory .../MyApp
When saving a file, The color of the injection app's icon changes to green and then reverts back. But there is not new log about Injection apearing in the console
The modified code didn't take effect either.
Any ideas?
Hi, I can't explain why on earth the would be happening. You may want to get started with the newer simple version of Injection https://github.com/johnno1962/InjectionNext or a simpler client app.
Sorry. I re-verified and found that the modified code does take effect. It's just that the status of Injection isn't output in real-time on the console.