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
Related
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)
I followed facebook documents to develop invite friend to ios app from here: App Invites for iOS ... Here is my code:
#implementation ViewController
FBSDKAppInviteContent *content;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
content =[[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:#"https://fb.me/1569122770021958"]];
//optionally set previewImageURL
content.previewImageURL = [NSURL URLWithString:#"http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg"];
}
And then I have defined an action button as follow:
- (IBAction)InviteFriends:(id)sender {
// present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
[FBSDKAppInviteDialog showWithContent:content delegate:sender];
}
However I received an error as follow:
2015-04-30 19:09:06.850 LoopApp[6338:120645] -[UIButton appInviteDialog:didCompleteWithResults:]: unrecognized selector sent to instance 0x7fbdd870f9d0
2015-04-30 19:09:06.852 LoopApp[6338:120645] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton appInviteDialog:didCompleteWithResults:]: unrecognized selector sent to instance 0x7fbdd870f9d0'
It says I haven't defined appInviteDialog:didCompleteWithResults: so I added this method as follow:
- (void) appInviteDialog: (FBSDKAppInviteDialog *)appInviteDialoge didFailWithError:(NSError *)error
{
NSLog(#"Session connection failed with error %#",[error self]);
}
I can go all the steps to select my friends and when I press button to share it shares but when it wants to go back to app crashes and it give me same error as above. I appreciate if anyone can help me why this is happening.
-[UIButton appInviteDialog:didCompleteWithResults:]: unrecognized selector sent to instance 0x7fabc3dbb840
2015-04-30 19:23:29.305 LoopApp[6423:125823] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton appInviteDialog:didCompleteWithResults:]: unrecognized selector sent to instance 0x7fabc3dbb840'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ed0ea75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010e5febb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010ed15d1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010ec6d9dc ___forwarding___ + 988
4 CoreFoundation 0x000000010ec6d578 _CF_forwarding_prep_0 + 120
5 LoopApp 0x000000010dfb71e1 -[FBSDKAppInviteDialog _invokeDelegateDidCompleteWithResults:] + 297
6 LoopApp 0x000000010dfb70a5 -[FBSDKAppInviteDialog _handleCompletionWithDialogResults:error:] + 67
7 LoopApp 0x000000010dfb6ed9 __28-[FBSDKAppInviteDialog show]_block_invoke + 131
8 LoopApp 0x000000010df92f51 -[FBSDKApplicationDelegate applicationDidBecomeActive:] + 194
9 CoreFoundation 0x000000010ecde7fc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
10 CoreFoundation 0x000000010ebde204 _CFXNotificationPost + 2484
11 Foundation 0x000000010e158df8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
12 UIKit 0x000000010f33bfc8 -[UIApplication _stopDeactivatingForReason:] + 363
13 UIKit 0x000000010f350ea2 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:] + 2648
14 FrontBoardServices 0x0000000112831243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
15 CoreFoundation 0x000000010ec43c7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x000000010ec399c5 __CFRunLoopDoBlocks + 341
17 CoreFoundation 0x000000010ec39785 __CFRunLoopRun + 2389
18 CoreFoundation 0x000000010ec38bc6 CFRunLoopRunSpecific + 470
19 GraphicsServices 0x0000000113230a58 GSEventRunModal + 161
20 UIKit 0x000000010f341580 UIApplicationMain + 1282
21 LoopApp 0x000000010df88f93 main + 115
22 libdyld.dylib 0x00000001114ff145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
The problem is that you are setting your button as the delegate for the FBSDKAppInviteDialog. The UIButton does not conform to the FBSDKAppInviteDialogDelegate protocol and therefore it crashes.
To fix this, change your code so that the delegate is nil or self (if self conforms to the FBSDKAppInviteDialogDelegate protocol):
- (IBAction)InviteFriends:(id)sender {
[FBSDKAppInviteDialog showWithContent:content delegate:self];
}
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.)
I am having an unrecognized selector sent to instance issue. I know which line I am having problem with, but I don't understand why it doesn't recognize it. (I tested this code in when I was creating my container views and it works just fine. But for some reason when I merge it to my main project I am getting this error.)
This is my console output:
2013-12-20 16:47:59.633[8545:70b] -[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250
2013-12-20 16:47:59.659[8545:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250'
*** First throw call stack:
(
0 CoreFoundation 0x01c075e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0198a8b6 objc_exception_throw + 44
2 CoreFoundation 0x01ca4903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01bf790b ___forwarding___ + 1019
4 CoreFoundation 0x01bf74ee _CF_forwarding_prep_0 + 14
5 TProduct 0x0000566f -[GameViewController changeViews:] + 143
6 TProduct 0x00005404 -[GameViewController timerTick:] + 532
7 Foundation 0x015c1927 __NSFireTimer + 97
8 CoreFoundation 0x01bc5bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
9 CoreFoundation 0x01bc55bd __CFRunLoopDoTimer + 1181
10 CoreFoundation 0x01bad628 __CFRunLoopRun + 1816
11 CoreFoundation 0x01bacac3 CFRunLoopRunSpecific + 467
12 CoreFoundation 0x01bac8db CFRunLoopRunInMode + 123
13 GraphicsServices 0x0387b9e2 GSEventRunModal + 192
14 GraphicsServices 0x0387b809 GSEventRun + 104
15 UIKit 0x006f8d3b UIApplicationMain + 1225
16 TProduct 0x000070fd main + 141
17 libdyld.dylib 0x0224570d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
and this is the part that it doesn't recognize
GameViewController.m
-(void)changeViews:(NSString *)gameStateSegueIdentifier
{
NSLog(#"show view gameStateSegueIdentifier :%#",gameStateSegueIdentifier);
[self.containerController decideViewController:gameStateSegueIdentifier];
}
and this is the method I am calling
ContainerViewController.m
-(void)decideViewController:(NSString *)gameStateSegueIdentifier
{
if (gameStateSegueIdentifier == _currentSegueIdentifier) {
return;
}
while (gameStateSegueIdentifier != _currentSegueIdentifier) {
NSLog(#"this is the gameStateSegueIdentifier %#",gameStateSegueIdentifier);
NSLog(#"this is the currentSegueIdentifier %#",_currentSegueIdentifier);
[self changeViewControllers];
}
}
I understand that there are lots of "unrecognized selector sent to instance" questions already. But so far, I wasn't able to find an answer for my case. I appreciate the help.
The error message you're getting explains the problem:
2013-12-20 16:47:59.633[8545:70b] -[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250
This is telling you that an instance of the class UIViewController got the message decideViewController:. UIViewController does not respond to this message. So, it seems that self.containerController is a UIViewController rather than a ContainerViewController. (If it was a ContainerViewController, it would say so in the error message.)
The fact that the property is declared as a ContainerViewController doesn't mean that there's actually a ContainerViewController in it. Go to where you actually create this object and assign it to that property, and ensure you're creating it as the correct class.
when the selector is not recognized you don't need to show the code for the selector, because it is not executed.
Show the property line of containerController.
Are you 100% sure that self.containerController is a ContainerViewController, your error message shows a UIViewController, so you are doing something special like cluster or a category?
Are you using #import "ContainerViewController"?
Is the method in the #implementation #end part?
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?