Terminating app due to uncaught exception 'NSInvalidArgumentException', - iphone

i hav this error. can anyone help me...
Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00dc40bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d33966 ___forwarding___ + 966
4 CoreFoundation 0x00d33522 _CF_forwarding_prep_0 + 50
5 UIKit 0x002b24fd -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x00342799 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00344c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x003437d8 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x002d6ded -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x002b7c37 -[UIApplication sendEvent:] + 447
11 UIKit 0x002bcf2e _UIApplicationHandleEvent + 7576
12 GraphicsServices 0x0171a992 PurpleEventCallback + 1550
13 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979
16 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
18 GraphicsServices 0x017191c4 GSEventRunModal + 217
19 GraphicsServices 0x01719289 GSEventRun + 115
20 UIKit 0x002c0c93 UIApplicationMain + 1160
21 BasicNavigation 0x00001ea0 main + 102
22 BasicNavigation 0x00001e31 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
(gdb)

When you are getting this error?
NSInvalidArgumentException
Name of an exception that occurs when you pass an invalid argument
to a method, such as a nil pointer where a non-nil object is required.

-[NSObject(NSObject) doesNotRecognizeSelector:]
indicates that one of your objects does not recognize the selector method. You are probably calling a method using an object which does not perform the particular method. Please post your code so that you can get the exact reason.

Related

SIGABRT Error on Button Click xcode

I am having a strange problem in xcode. i created a button in xib and connected to a function. I am printing the message inside the function. That's all, when i click the button i get the following error. I tried clean and deleted app from my simulator.
-(IBAction)languageSelection:(id)sender is my function name
-[NSCFString languageSelection:]: unrecognized selector sent to instance 0x713cd40
2012-05-03 15:14:35.055 Example[33420:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString languageSelection:]: unrecognized selector sent to instance 0x713cd40'
*** Call stack at first throw:
(
0 CoreFoundation 0x02966919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02ab45de objc_exception_throw + 47
2 CoreFoundation 0x0296842b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x028d8116 ___forwarding___ + 966
4 CoreFoundation 0x028d7cd2 _CF_forwarding_prep_0 + 50
5 UIKit 0x005ece14 -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x006766c8 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00678b4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x006776f7 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x006102ff -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x005f21ec -[UIApplication sendEvent:] + 447
11 UIKit 0x005f6ac4 _UIApplicationHandleEvent + 7495
12 GraphicsServices 0x02dedafa PurpleEventCallback + 1578
13 CoreFoundation 0x02947dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x028a8737 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x028a59c3 __CFRunLoopRun + 979
16 CoreFoundation 0x028a5280 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x028a51a1 CFRunLoopRunInMode + 97
18 GraphicsServices 0x02dec2c8 GSEventRunModal + 217
19 GraphicsServices 0x02dec38d GSEventRun + 115
20 UIKit 0x005fab58 UIApplicationMain + 1160
21 Example 0x000023c9 main + 121
22 Example 0x00002345 start + 53
)
terminate called after throwing an instance of 'NSException'
this is perhaps you are trying to call a method languageSelection with object that is infact string, but you have passed into another object which has languageSelection method.
this is because you think the object is what you want but the pointer passed the allocated memory to string and hence it will work as string. when you try to call method it crashes because it didn't find the method in string. check your object type just before u use it anywhere

How to debug 'unrecognized selector sent to instance' error in Xcode?

2011-04-26 01:36:17.914 Protoype_Test1[15119:207] -[Protoype_Test1ViewController saveImage]: unrecognized selector sent to instance 0x5f60e60
2011-04-26 01:36:17.933 Protoype_Test1[15119:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Protoype_Test1ViewController saveImage]: unrecognized selector sent to instance 0x5f60e60'
*** Call stack at first throw:
(
0 CoreFoundation 0x0126cbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010615c2 objc_exception_throw + 47
2 CoreFoundation 0x0126e6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x011de366 ___forwarding___ + 966
4 CoreFoundation 0x011ddf22 _CF_forwarding_prep_0 + 50
5 UIKit 0x00366a6e -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x003f51b5 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x003f7647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x003f61f4 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x0038b0d1 -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x0036c37a -[UIApplication sendEvent:] + 447
11 UIKit 0x00371732 _UIApplicationHandleEvent + 7576
12 GraphicsServices 0x01a83a36 PurpleEventCallback + 1550
13 CoreFoundation 0x0124e064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x011ae6f7 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x011ab983 __CFRunLoopRun + 979
16 CoreFoundation 0x011ab240 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x011ab161 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01a82268 GSEventRunModal + 217
19 GraphicsServices 0x01a8232d GSEventRun + 115
20 UIKit 0x0037542e UIApplicationMain + 1160
21 Protoype_Test1 0x00001c34 main + 102
22 Protoype_Test1 0x00001bc5 start + 53
)
terminate called after throwing an instance of 'NSException'
see if the IBAction of the buttons are connected properly. I guess they are not properly connected
It would be much helpful if you post your source code rather than error out come.
Anyway i think you are trying to call an instance method through class reference.
The problem is here:
[Protoype_Test1ViewController saveImage]
It should be:
[protoype_Test1ViewController saveImage]
This is a common mistake when relay much on auto complete.

iphone App crashes while Parsing

my app is crashed as it execute [NSXMLParser parse]; statement,and
i am getting following :
2011-03-01 09:36:31.735 MasterApp[228:207] -[NSCFString bytes]: unrecognized selector sent to instance 0x5f6b000
2011-03-01 09:36:31.738 MasterApp[228:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString bytes]: unrecognized selector sent to instance 0x5f6b000'
* Call stack at first throw:
(
0 CoreFoundation 0x0252eb99 exceptionPreprocess + 185
1 libobjc.A.dylib 0x0267e40e objc_exception_throw + 47
2 CoreFoundation 0x025306ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x024a02b6 __forwarding + 966
4 CoreFoundation 0x0249fe72 _CF_forwarding_prep_0 + 50
5 Foundation 0x00114afc -[NSXMLParser parse] + 147
6 MasterApp 0x0000c731 -[identifierList getUrl] + 994
7 MasterApp 0x0000c306 -[identifierList actionSheet:clickedButtonAtIndex:] + 56
8 UIKit 0x0077047d -[UIActionSheet(Private) _buttonClicked:] + 258
9 UIKit 0x002dc7f8 -[UIApplication sendAction:to:from:forEvent:] + 119
10 UIKit 0x00367de0 -[UIControl sendAction:to:forEvent:] + 67
11 UIKit 0x0036a262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
12 UIKit 0x00368e0f -[UIControl touchesEnded:withEvent:] + 458
13 UIKit 0x003003d0 -[UIWindow _sendTouchesForEvent:] + 567
14 UIKit 0x002e1cb4 -[UIApplication sendEvent:] + 447
15 UIKit 0x002e69bf _UIApplicationHandleEvent + 7672
16 GraphicsServices 0x02d8a822 PurpleEventCallback + 1550
17 CoreFoundation 0x0250fff4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
18 CoreFoundation 0x02470807 __CFRunLoopDoSource1 + 215
19 CoreFoundation 0x0246da93 __CFRunLoopRun + 979
20 CoreFoundation 0x0246d350 CFRunLoopRunSpecific + 208
21 CoreFoundation 0x0246d271 CFRunLoopRunInMode + 97
22 GraphicsServices 0x02d8900c GSEventRunModal + 217
23 GraphicsServices 0x02d890d1 GSEventRun + 115
24 UIKit 0x002eaaf2 UIApplicationMain + 1160
25 MasterApp 0x00001dbc main + 102
26 MasterApp 0x00001d4d start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
thank you in advance
i just try to use "urlData" instead of webData in xmlParser = [[NSXMLParser alloc] initWithData:urlData]; and now it parse very well

App crashes when I pop a view from NavigationController using a UIButton

I'm pushing a simple view onto a NavigationController. The view loads fine, and when I use the built-in back button, it is properly popped.
However, when I try and pop the view with my own UIButton within the view, I get a crash.
This is the action run by my UIButton:
-(IBAction)iAgreePressed {
[[self navigationController] popViewControllerAnimated:YES];}
Am I missing something obvious here?
This is the error coming back in the console:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[LegalAgreementController iAgreePressed:]: unrecognized selector sent to instance 0x6169190'
*** Call stack at first throw:
(
0 CoreFoundation 0x0283ab99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0298a40e objc_exception_throw + 47
2 CoreFoundation 0x0283c6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x027ac2b6 ___forwarding___ + 966
4 CoreFoundation 0x027abe72 _CF_forwarding_prep_0 + 50
5 UIKit 0x002d67f8 -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x00361de0 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00364262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x00362e0f -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x002fa3d0 -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x002dbcb4 -[UIApplication sendEvent:] + 447
11 UIKit 0x002e09bf _UIApplicationHandleEvent + 7672
12 GraphicsServices 0x02f57822 PurpleEventCallback + 1550
13 CoreFoundation 0x0281bff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x0277c807 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x02779a93 __CFRunLoopRun + 979
16 CoreFoundation 0x02779350 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x02779271 CFRunLoopRunInMode + 97
18 GraphicsServices 0x02f5600c GSEventRunModal + 217
19 GraphicsServices 0x02f560d1 GSEventRun + 115
20 UIKit 0x002e4af2 UIApplicationMain + 1160
21 WeiglWorksMobileCommander 0x00001fa2 main + 84
22 WeiglWorksMobileCommander 0x00001f45 start + 53
23 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Thank you for your time!
Method signatures don't match. The button is sending
-[LegalAgreementController iAgreePressed:]
but you defined
-[LegalAgreementController iAgreePressed] //(note one arg versus no arg)
IBActions should be defined as:
- (IBAction) someMethod:(id)sender
You don't strictly have to include that arg, but you want to for consistency.

Getting a crash when I launch OpenFeint dashboard

I recently tried to integrate open feint into my app. When my app launches, the 'Welcome back player xxxx' at the bottom works so I know that open feint is working. However, when I press the button that has this linked to it
-(IBAction) leaderboard: (id) sender
{
[OpenFeint launchDashboard];
}
I get this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DemoAppViewController leaderboard]: unrecognized selector sent to instance 0x7a40250'
*** Call stack at first throw:
(
0 CoreFoundation 0x02d71919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02ebf5de objc_exception_throw + 47
2 CoreFoundation 0x02d7342b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02ce3116 ___forwarding___ + 966
4 CoreFoundation 0x02ce2cd2 _CF_forwarding_prep_0 + 50
5 UIKit 0x00695e14 -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x0071f6c8 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00721b4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x007206f7 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x006b92ff -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x0069b1ec -[UIApplication sendEvent:] + 447
11 UIKit 0x0069fac4 _UIApplicationHandleEvent + 7495
12 GraphicsServices 0x032f3afa PurpleEventCallback + 1578
13 CoreFoundation 0x02d52dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x02cb3737 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x02cb09c3 __CFRunLoopRun + 979
16 CoreFoundation 0x02cb0280 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x02cb01a1 CFRunLoopRunInMode + 97
18 GraphicsServices 0x032f22c8 GSEventRunModal + 217
19 GraphicsServices 0x032f238d GSEventRun + 115
20 UIKit 0x006a3b58 UIApplicationMain + 1160
21 DemoApp 0x00004f84 main + 102
22 DemoApp 0x00004f15 start + 53
)
terminate called after throwing an instance of 'NSException'
I haven't been able to find any post on how to resolve this so any help would be greatly appreciated! Thanks in advance
From the exception it looks to me as if you tried to message your object with leaderboard when the method requires one argument and as such you should call it with one.
That is, it looks like you are doing something like this:
[someDemoAppViewControllerObject leaderboard]
When your should be doing this:
[someDemoAppViewControllerObject leaderboard:theSenderObject]
Quite often self is used as theSenderObject.
is
-(IBAction) leaderboard: (id) sender
declared in the .h file?