[UICachedDeviceRGBColor stringByReplacingOccurrencesOfString:withString:]: - ios

I've this error, when I try to use UIColor : [UICachedDeviceRGBColor stringByReplacingOccurrencesOfString:withString:]: unrecognized selector
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICachedDeviceRGBColor stringByReplacingOccurrencesOfString:withString:]: unrecognized selector sent to instance 0x7f957952d870'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103363d85 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000102ac7deb objc_exception_throw + 48
2 CoreFoundation 0x000000010336cd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001032b2cfa ___forwarding_ + 970

The crash log says that you try send message to UICachedDeviceRGBColor class but it doesn't have method with name stringByReplacingOccurrencesOfString:withString: and it doesn't inherit from NSString. This method declare only in NSString class.

Related

FIRMessaging should be called from main thread only

I am using intel multi-os-engine to build my iOS-app. When trying to setup Firebase Messaging I get the following error:
* Assertion failure in -FIRMessaging teardown, /Users/hpbaxxter/StudioProjects/app/ios/xcode/Pods/FirebaseMessaging/Firebase/Messaging/FIRMessaging.m:374
2019-01-24 15:13:15.988333+0100 SkipAndGo[4195:75192] * Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'FIRMessaging should be
called from main thread only.'
*** First throw call stack: ( 0 CoreFoundation 0x00000000177921bb __exceptionPreprocess + 331 1 libobjc.A.dylib
0x0000000016d30735 objc_exception_throw + 48 2 CoreFoundation
0x0000000017791f42 +[NSException raise:format:arguments:] + 98 3
Foundation 0x0000000013de9940
-[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166 4
SkipAndGo 0x000000000b5b512a -[FIRMessaging
teardown] + 234 5 SkipAndGo
0x000000000b5b3da3 -[FIRMessaging dealloc] + 195 6 libobjc.A.dylib
0x0000000016d42dcc _ZN11objc_object17sidetable_releaseEb + 202 7
??? 0x0000000044f6ec79 0x0 +
1157033081 ) libc++abi.dylib: terminating with uncaught exception of
type NSException
I already read Q&A's like this one here.
This is my Code when setting up FIRMessaging:
Globals.dispatch_async(Globals.dispatch_get_main_queue(), new Globals.Block_dispatch_async() {
#Override
public void call_dispatch_async() {
FIRMessaging.alloc().setDelegate(CLOUDMESSAGES_DELEGTE);
application.registerForRemoteNotifications();
}
}
);
You should use the class method messaging to get the instance. Looks like you are creating a new instance instead of using the messaging() method.
This method return what you want.
/**
* FIRMessaging
*
* #return An instance of FIRMessaging.
*/
+ (instancetype)messaging NS_SWIFT_NAME(messaging());

Swift 3: -[_SwiftValue mergeType]: unrecognized selector sent to instance

I am getting a '-[_SwiftValue mergeType]: unrecognized selector sent to instance' error whenever I try to save a managed object context after doing a delete or an update of a record. For example:
context.delete(managedObject)
follow by
context.save()
and yes, context.save() is in a do-try-catch.
Records insert just fine, but the delete is throwing an exception. Stack trace is as follows:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue mergeType]: unrecognized selector sent to instance 0x60800005b0f0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010afac34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a5f021e objc_exception_throw + 48
2 CoreFoundation 0x000000010b01bf34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010af31c15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010af31798 _CF_forwarding_prep_0 + 120
5 CoreData 0x000000010aae203a -[NSManagedObjectContext(_NSInternalAdditions) _validateObjects:forOperation:error:exhaustive:forSave:] + 1946
6 CoreData 0x000000010aae1836 -[NSManagedObjectContext(_NSInternalAdditions) _validateChangesForSave:] + 422
7 CoreData 0x000000010aae1476 -[NSManagedObjectContext(_NSInternalChangeProcessing) _prepareForPushChanges:] + 214
8 CoreData 0x000000010aaddeb2 -[NSManagedObjectContext save:] + 562
Trace starts right after it leaves my code.
Any insight would be helpful.
You may get this error when you use code like this, to set a merge policy:
context.mergePolicy = NSMergePolicyType.mergeByPropertyStoreTrumpMergePolicyType
Instead use this:
context.mergePolicy = NSMergePolicy(merge: .mergeByPropertyStoreTrumpMergePolicyType)

iOS NSMutableAttributedString Crash With unrecognized selector

Help!
the crash happens at :
[emtionString replaceCharactersInRange:range withString:imageAndRangeDicArray[i][#"image"]];
When NSMutableAttributedString is replaced with attributeString
This is the stack trace:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableAttributedString _encodingCantBeStoredInEightBitCFString]: unrecognized selector sent to instance 0x7fe8f34f52f0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107e95f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107b2ebb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107e9d04d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107df527c ___forwarding___ + 988
4 CoreFoundation 0x0000000107df4e18 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x0000000107db8195 __CFStringCheckAndReplace + 597
6 CoreFoundation 0x0000000107db7f1b -[__NSCFString replaceCharactersInRange:withString:] + 27
7 Foundation 0x00000001076da63e -[NSConcreteMutableAttributedString replaceCharactersInRange:withString:] + 337
What types are emtionString and imageAndRangeDicArray[i][#"image"]?
According to the docs, that method wants an NSString as the withString.
If you're passing in an NSAttributedString instead it won't work. (It seems like NSAttributedString should be a subclass of NSString but it's not.)

Apple AWT Internal Exception: -[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960

I'm trying to start an application with some native jogl libraries under mac. It runs on linux and windows. The error message is:
2012-10-26 16:35:49.160 java[1440:1703] invalid drawable
2012-10-26 16:35:49.163 java[1440:1703] -[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960
2012-10-26 16:35:49.164 java[1440:1703] Apple AWT Internal Exception: -[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960
2012-10-26 16:35:49.165 java[1440:1703] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff929e60a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8f7533f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff92a7c6ea -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff929d45ce ___forwarding___ + 414
4 CoreFoundation 0x00007fff929d43b8 _CF_forwarding_prep_0 + 232
5 AppKit 0x00007fff8c6395be -[NSOpenGLContext setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:] + 59
6 libjogl_desktop.jnilib 0x00000001284708cb setContextPBuffer + 203
7 libjogl_desktop.jnilib 0x00000001284d428b Java_jogamp_opengl_macosx_cgl_CGL_setContextPBuffer__JJ + 43
8 ??? 0x000000010790ef90 0x0 + 4421906320
)
libc++abi.dylib: terminate called throwing an exception
Process finished with exit code 134
Any idea?

Problem to trace the route between two points

i try to trace the route between two points in my iPhone application using cloudmade, the application crashes and i got this report :
2011-06-23 17:07:56.153 TopStation[1307:9b03] +[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4
2011-06-23 17:07:56.154 TopStation[1307:9b03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4'
*** Call stack at first throw:
(
0 CoreFoundation 0x02b79919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0298e5de objc_exception_throw + 47
2 CoreFoundation 0x02b7b4eb +[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02aeb116 ___forwarding___ + 966
4 CoreFoundation 0x02aeacd2 _CF_forwarding_prep_0 + 50
5 TopStation 0x00072bbf -[CMRoutingManager findRouteFrom:] + 580
6 Foundation 0x0012f2a8 -[NSThread main] + 81
7 Foundation 0x0012f234 __NSThread__main__ + 1387
8 libSystem.B.dylib 0x910aa7fd _pthread_start + 345
9 libSystem.B.dylib 0x910aa682 thread_start + 34
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
Data Formatters unavailable (Error calling dlopen for: "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib": "dlopen(/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib, 10): no suitable image found. Did find:
/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib: out of address space")
(gdb)
My code is as below :
- (void)viewDidLoad {
[super viewDidLoad];
[RMMapView class];
TokenManager* tokenManager = [[TokenManager alloc] initWithApikey:#"a53b3323702f42fc8486e24df34f9ac3"];
_routingManager = [[CMRoutingManager alloc] initWithMapView:mapView tokenManager:tokenManager];
_routingManager.delegate = self;
CLLocationCoordinate2D from;
from.latitude= 53.358311;
from.longitude=-6.481934;
CLLocationCoordinate2D to;
to.latitude=52.657616;
to.longitude=-8.635254;
CMRoutingVehicle transport = CMVehicleCar;//CMVehicleWalking or CMVehicleBike
[_routingManager findRouteFrom:from to:to onVehicle:transport];
}
Any help will be appreciated :)
This exception
2011-06-23 17:07:56.154 TopStation[1307:9b03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4'
says, that you are sending a message to an class, that doesnt have the method, that fits to it. +[NSArray arrayWithContentsOfURL:headers:]
my guess: You are not importing a Category on NSArray, that declares and implements +arrayWithContentsOfURL:headers:
And make sure you added the linker flags -ObjC
-all_load

Resources