I get this crash on iOS 7,
Assertion failed: (result == KERN_SUCCESS), function + [XPCMachSendRight wrapSendRight:], file /SourceCache/XPCObjects/XPCObjects-46/XPCMachSendRight.m, line27.
Steps which lead to this crash are,
Opening MFMailComposeViewController
Press home button
App crashed.
Here is crash report,
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x393bf1fc 0x393ac000 + 78332
1 libsystem_pthread.dylib 0x39426a4f 0x39423000 + 14927
2 libsystem_c.dylib 0x39370083 0x39326000 + 303235
3 libsystem_c.dylib 0x39370035 0x39326000 + 303157
4 libsystem_c.dylib 0x3934fc67 0x39326000 + 171111
5 XPCObjects 0x375a7905 0x375a2000 + 22789
6 UIKit 0x317b41f9 0x3128d000 + 5403129
7 UIKit 0x31529d45 0x3128d000 + 2739525
8 QuartzCore 0x30f54af9 0x30f13000 + 269049
9 QuartzCore 0x30f1b077 0x30f13000 + 32887
10 QuartzCore 0x30f1ae1b 0x30f13000 + 32283
11 UIKit 0x31318deb 0x3128d000 + 572907
12 UIKit 0x31318d53 0x3128d000 + 572755
13 CoreFoundation 0x2eaddf6f 0x2ea3e000 + 655215
14 CoreFoundation 0x2eadb8fb 0x2ea3e000 + 645371
15 CoreFoundation 0x2eadbbb5 0x2ea3e000 + 646069
16 CoreFoundation 0x2ea4653d 0x2ea3e000 + 34109
17 CoreFoundation 0x2ea4631f 0x2ea3e000 + 33567
18 GraphicsServices 0x337762e7 0x3376f000 + 29415
19 UIKit 0x312fd1e1 0x3128d000 + 459233
20 MYAPP 0x0002d5c9 main (main.mm:18)
21 MYAPP 0x0002d524 start + 36
I found similar problem mentioned here: app get crashed while navigating to RootViewController from Message popup
Crash occurs rarely. I don't know what [XPCMachSendRight wrapSendRight:] this is and how to prevent it from crashing my app?
Before using MFMailComposeViewController class, you must always check to see if the current device is configured to send email at all using the canSendMail method. If the user’s device is not set up for the delivery of email, you can notify the user or simply disable the email dispatch features in your application. You should not attempt to use this interface if the canSendMail method returns NO.
Use this code....
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:#"A Message from Bloomingkids"];
NSArray *toRecipients = [NSArray arrayWithObjects:#"support#bloomingkids.com", nil];
[mailer setToRecipients:toRecipients];
UIImage *myImage = [UIImage imageNamed:#"bloomingKidsLogo.png"];
NSData *imageData = UIImagePNGRepresentation(myImage);
[mailer addAttachmentData:imageData mimeType:#"image/png" fileName:#"Images"];
NSString *emailBody = #"Have you seen the Bloomingkids web site?";
[mailer setMessageBody:emailBody isHTML:NO];
[self presentViewController:mailer animated:YES completion:nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Failure"
message:#"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:#"OK"
otherButtonTitles: nil];
[alert show];
}
Add any email account in your device first means setup an email account...
Related
I have a viewcontroller functioning as QRCode scanner, and the below is the part about the scan-output. It works well on iOS 12/13, but only crashed on iOS 14.
AVMetadataMachineReadableCodeObject *metadataObj = [metadataObjects objectAtIndex:0];
if ([[metadataObj type] isEqualToString:AVMetadataObjectTypeQRCode]) {
NSString *codeString=[metadataObj stringValue];
[self performSelectorOnMainThread:#selector(stopReading) withObject:nil waitUntilDone:NO];
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:#"QRCode is Scanned"
message:#""
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction
actionWithTitle:#"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
// [self startReading];
// [_viewPreview bringSubviewToFront:_previewFrame];
NSLog(#"The Scanned QRCode as %#",codeString);
[self.delegate addItemViewController:self didFinishEnteringItem:codeString];
[self.navigationController popViewControllerAnimated:YES];
}];
[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];
and then the crash log came out as below, and this was ocurred on the code as "UIAlertController * alert", I think there might be something wrong for iOS 14.
2021-04-15 16:21:04.194 ntpc[5257:1741639] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0 CoreAutoLayout 0x00000001c1b80548 011F5CA5-D31B-3CDC-83C2-C7CB66064075 + 62792
1 CoreAutoLayout 0x00000001c1b80904 011F5CA5-D31B-3CDC-83C2-C7CB66064075 + 63748
2 UIKitCore 0x00000001b0204ef0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 16047856
3 UIKitCore 0x00000001b0206294 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 16052884
4 UIKitCore 0x00000001af33d0a0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 549024
5 UIKitCore 0x00000001af338880 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 530560
6 UIKitCore 0x00000001af338aec CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 531180
7 UIKitCore 0x00000001af338f7c CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 532348
8 UIKitCore 0x00000001af33d92c CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 551212
9 UIKitCore 0x00000001af33d778 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 550776
10 UIKitCore 0x00000001af318c94 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 400532
11 UIKitCore 0x00000001af724114 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4641044
12 UIKitCore 0x00000001af7247e8 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4642792
13 UIKitCore 0x00000001af73a820 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4732960
14 UIKitCore 0x00000001af732e18 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4701720
15 UIKitCore 0x00000001af7363ac CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4715436
16 UIKitCore 0x00000001af737240 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4719168
17 UIKitCore 0x00000001af737550 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4719952
18 UIKitCore 0x00000001af737190 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4718992
19 UIKitCore 0x00000001af737614 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4720148
20 ntpc 0x00000001030dce88 ntpc + 1429128
21 AVFCapture 0x00000001c6794b38 083B23EB-2DC8-3813-817B-6F1A40C9EC24 + 498488
22 AVFCapture 0x00000001c6793c60 083B23EB-2DC8-3813-817B-6F1A40C9EC24 + 494688
23 CMCapture 0x00000001c67ff5e4 BD2C0FD0-B1F9-374F-9D59-2B5266446EFF + 153060
24 CMCapture 0x00000001c6a61304 BD2C0FD0-B1F9-374F-9D59-2B5266446EFF + 2650884
25 libdispatch.dylib 0x00000001ad1b3280 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 397952
26 libdispatch.dylib 0x00000001ad158390 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 25488
27 libdispatch.dylib 0x00000001ad1690ac AF27E74C-BE4A-3364-BB27-AED9916CE02D + 94380
28 libdispatch.dylib 0x00000001ad15bc94 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 40084
29 libdispatch.dylib 0x00000001ad15c8a8 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 43176
30 libdispatch.dylib 0x00000001ad166338 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 82744
31 libsystem_pthread.dylib 0x00000001f5d9d5a4 _pthread_wqthread + 272
32 libsystem_pthread.dylib 0x00000001f5da0874 start_wqthread + 8
)
2021-04-15 16:21:04.195 ntpc[5257:1741639] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'
*** First throw call stack:
(0x1ad57a9d8 0x1c18fdb54 0x1c1b80640 0x1c1b80904 0x1b0204ef0 0x1b0206294 0x1af33d0a0 0x1af338880 0x1af338aec 0x1af338f7c 0x1af33d92c 0x1af33d778 0x1af318c94 0x1af724114 0x1af7247e8 0x1af73a820 0x1af732e18 0x1af7363ac 0x1af737240 0x1af737550 0x1af737190 0x1af737614 0x1030dce88 0x1c6794b38 0x1c6793c60 0x1c67ff5e4 0x1c6a61304 0x1ad1b3280 0x1ad158390 0x1ad1690ac 0x1ad15bc94 0x1ad15c8a8 0x1ad166338 0x1f5d9d5a4 0x1f5da0874)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please help....
As the error message says you try to modify the layout on a background thread:
This application is modifying the autolayout engine from a background thread
You have to present the alert controller on the main thread:
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alert animated:YES completion:nil]
});
All interactions with the UI must be done in the Main Thread so you need to wrap it in a dispatch in the main thread, i.e:
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertController * alert = [UIAlertController alertControllerWithTitle:#"QRCode is Scanned" message:#"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:#"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[self.delegate addItemViewController:self didFinishEnteringItem:codeString];
[self.navigationController popViewControllerAnimated:YES];
}];
[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];
});
On the other hand, this crash is not real. It is caused by the Main Thread checker that Xcode has enabled by default. I recommend you to keep it enabled.
You can find more information in this link Main Thread Checker
from the log reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'
You can print whether it's in the main thread. If not, You can change the code to main thread. because only the main thread can change and layout the UIView.
Our App Find a Foundation crash, only in iOS11. How to solve it ?
Fatal Exception: NSRangeException
NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds
0 CoreFoundation 0x184f8bd38 __exceptionPreprocess
1 libobjc.A.dylib 0x1844a0528 objc_exception_throw
2 CoreFoundation 0x184f8bc80 -[NSException initWithCoder:]
3 Foundation 0x18587c168 -[NSMutableRLEArray replaceObjectsInRange:withObject:length:]
4 Foundation 0x18588262c -[NSConcreteMutableAttributedString replaceCharactersInRange:withAttributedString:]
5 CoreFoundation 0x184e65bec -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
6 UIKit 0x18ec677b8 -[UILayoutManagerBasedDraggableGeometry draggableObjectsForTextRange:]
I could reproduce it in iOS 13.0 beta 4 with a sample app showing a UITextView with a special attributed string including a link. It crashes when tap-holding or dragging the link.
NSMutableAttributedString *aString = [[NSMutableAttributedString alloc] initWithString:#""];
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = [[UIImage imageNamed:#"weblink"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
attachment.bounds = CGRectMake(0, 0, 15, 15);
[aString appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
[aString appendAttributedString:[[NSAttributedString alloc] initWithString:#" More Information"]];
[aString addAttribute:NSLinkAttributeName value:[NSURL URLWithString:#"https://www.apple.com"] range:NSMakeRange(0, aString.length)];
self.textView.attributedText = aString;
Filed on Feedback Assistant as FB6738178.
I had the same issue when use the method of UITextInput
replaceRange:(UITextRange *)range withText:(NSString *)text;
I cannot find the best solution, but I fix the crash by avoiding using special characters
'
in the 2nd parameter of replaceRange method
ps:the issue only occurred in iOS 11
I am getting the following crash in HockeyApp more seriously in iOS10. Please find the crash log as given below.
Thread 4 Crashed:
0 libobjc.A.dylib 0x0000000187242f30 objc_msgSend + 16
1 UIKit 0x000000018e86e914 -[UIWebDocumentView _updateSubviewCaches] + 36
2 UIKit 0x000000018e69093c -[UIWebDocumentView subviews] + 88
3 UIKit 0x000000018e941bd4 -[UIView(CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 68
4 UIKit 0x000000018e63d770 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1248
5 QuartzCore 0x000000018bb0640c -[CALayer layoutSublayers] + 144
6 QuartzCore 0x000000018bafb0e8 CA::Layer::layout_if_needed(CA::Transaction*) + 288
7 QuartzCore 0x000000018bafafa8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
8 QuartzCore 0x000000018ba77c64 CA::Context::commit_transaction(CA::Transaction*) + 248
9 QuartzCore 0x000000018ba9f0d0 CA::Transaction::commit() + 508
10 QuartzCore 0x000000018ba9faf0 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 116
11 CoreFoundation 0x00000001887a57dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
12 CoreFoundation 0x00000001887a340c __CFRunLoopDoObservers + 368
13 CoreFoundation 0x00000001886d2068 CFRunLoopRunSpecific + 472
14 WebCore 0x000000018d273a2c RunWebThread(void*) + 452
15 libsystem_pthread.dylib 0x000000018788b860 _pthread_body + 236
16 libsystem_pthread.dylib 0x000000018788b770 _pthread_start + 280
17 libsystem_pthread.dylib 0x0000000187888dbc thread_start + 0
Any idea what is going on here ?
Seems like the following crash groups are also related.
Crash Group 1
[UIWebBrowserView _collectAdditionalSubviews]
objc_msgSend() selector name: autorelease
Crash Group 2
[UIWebDocumentView subviews]
objc_msgSend() selector name: arrayByAddingObjectsFromArray:
I am answering to my own question, since I am able to replicate this issue and found the root cause.
Please note the following.
1. I am using a UIWebView. First of all, this is not recommended.
2. The following way of implementation causes this issue. I am writing pseudo-code here to demonstrate the problem.
#implementation MyViewController
- (void)loadView {
//creating UIWebView Here
self.webView = [[UIWebView alloc] initWithFrame:_some_frame];
//setting the web view properties here.
//Adding to the view
[self.view addSubView: self.webView];
[self populateWebView];
}
- (void) populateWebView {
[self.webView loadHTMLString:_some_html
baseURL:[NSURL fileURLWithPath:_some_path]];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
if (self.webView) {
//The following two lines causing this issue.
self.webView.scrollView.contentInset = _some_insets;
self.webView.scrollView.scrollIndicatorInsets = _some_insets;
}
}
#end
3. The solution is given below.
#implementation MyViewController
- (void)loadView {
//creating UIWebView Here
self.webView = [[UIWebView alloc] initWithFrame:_some_frame];
//setting the web view properties here.
//Adding to the view
[self.view addSubView: self.webView];
[self populateWebView];
}
- (void) populateWebView {
[self.webView loadHTMLString:_some_html
baseURL:[NSURL fileURLWithPath:_some_path]];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
webView.scrollView.contentInset = _some_insets;
webView.scrollView.scrollIndicatorInsets = _some_insets;
}
#end
In my actual code, I was using a custom WebView class here by subclassing the UIWebView. Not think that will create some issue. The root cause is setting the "contentInset" and "scrollIndicatorInsets" in viewDidLayoutSubviews which is not a good idea. When I put the break points, "viewDidLayoutSubviews" called several times and eventually App crashes.
As a solution I moved the following part of the code into "webViewDidFinishLoad" which will call only when the WebView is ready after finished loading. So it makes sense to add this code under this delegate method.
webView.scrollView.contentInset = _some_insets;
webView.scrollView.scrollIndicatorInsets = _some_insets;
The stack is as below, how to fix this crash ?
It is only in iOS7 and why there is uitableview in the stack?
0 libobjc.A.dylib objc_msgSend + 5
1 UIKit -[UIAlertView(Private) modalItem:shouldDismissForButtonAtIndex:] + 62
2 UIKit -[_UIModalItemsCoordinator _notifyDelegateModalItem:tappedButtonAtIndex:] + 94
3 UIKit -[_UIModalItemAlertContentView tableView:didSelectRowAtIndexPath:] + 894
4 UIKit -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1078
5 UIKit -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 214
6 UIKit _applyBlockToCFArrayCopiedToStack + 316
7 UIKit _afterCACommitHandler + 430
8 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
- (id)initWithIdentifier:(LTAlertMsgIdentifier)alertIdentifier
delegate:(id /*<UIAlertViewDelegate>*/)delegate
cancelButtonTitle:(NSString *)cancelButtonTitle
otherButtonTitles:(NSString *)otherButtonTitles, ... {
LTAlertMsgManager *sharedAlertMsgMgr = [LTAlertMsgManager shareAlertManageInstance];
NSString *strMsg = [sharedAlertMsgMgr getLTAlertMsgByAlertID:alertIdentifier];
if ([NSString isBlankString:strMsg]){
// alert is invalid, if alert message is empty
return nil;
}
NSString *strTitle = [sharedAlertMsgMgr getLTAlertTitleByAlertID:alertIdentifier];
if (self = [super initWithTitle:([NSString isBlankString:strTitle] ? nil : strTitle)
message:strMsg
delegate:delegate
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:nil]){
va_list args;
va_start(args, otherButtonTitles);
for (NSString *arg = otherButtonTitles; arg != nil; arg = va_arg(args, NSString*))
{
[self addButtonWithTitle:arg];
}
va_end(args);
}
NSLog(#"cancel button index - %d", self.cancelButtonIndex);
return self;
}
The buttons in the UIAlertView are implemented using a UITableView. That's why tapping a button triggers a tableView:didSelectRowAtIndexPath.
Typical problems causing such errors are:
Alert not displayed from the main thread
Delegate already deallocated (make sure the alert delegate is retained somewhere for the entire life of the alert).
See iOS 7 bug or my bug in UIAlertView
UIAlertView delegate is
#property(nonatomic, assign) id delegate, so ensure alertView.delegate = nil when delegate is dealloced.
I want my app to continue gracefully when the online server messes up. I tried to wrap the dangerous line in a #try block. Yet it is still crashing like so:
the method:
+ (NSArray *)findAllFor:(NSObject *)ratable {
NSString *ratingsPath = [NSString stringWithFormat:#"%#%#/%#/%#%#",
[self getRemoteSite],
[ratable getRemoteCollectionName],
[ratable getRemoteId],
[self getRemoteCollectionName],
[self getRemoteProtocolExtension]];
Response *res = [ORConnection get:ratingsPath withUser:[[self class] getRemoteUser]
andPassword:[[self class] getRemotePassword]];
NSArray *ratings;
#try {
ratings = [self fromXMLData:res.body];
}
#catch (NSException *e) {
ratings = [NSArray array];
}
return ratings;
}
the stack trace:
Program received signal: “SIGABRT”.
2010-08-07 16:38:51.846 TalkToHer[68608:7003] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** Call stack at first throw:
(
0 CoreFoundation 0x02932919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02a805de objc_exception_throw + 47
2 CoreFoundation 0x0292858c -[__NSArrayI objectAtIndex:] + 236
3 TalkToHer 0x00009fa7 -[FromXMLElementDelegate parser:didEndElement:namespaceURI:qualifiedName:] + 425
4 Foundation 0x0017bcc1 _endElementNs + 453
5 libxml2.2.dylib 0x02d9deb6 xmlParseXMLDecl + 1353
6 libxml2.2.dylib 0x02da8bc1 xmlParseChunk + 3985
7 Foundation 0x0017b4c2 -[NSXMLParser parse] + 321
8 TalkToHer 0x0000b14d +[NSObject(XMLSerializableSupport) fromXMLData:] + 201
9 TalkToHer 0x00031a6c +[Rating findAllFor:] + 320
10 TalkToHer 0x00032d67 -[FirstClassContentPiece(Ratable) updateRatings] + 96
11 TalkToHer 0x00004d5f __-[InspirationController tableView:didSelectRowAtIndexPath:]_block_invoke_3 + 33
12 libSystem.B.dylib 0x9792efe4 _dispatch_call_block_and_release + 16
13 libSystem.B.dylib 0x97921a4c _dispatch_queue_drain + 249
14 libSystem.B.dylib 0x979214a8 _dispatch_queue_invoke + 50
15 libSystem.B.dylib 0x979212be _dispatch_worker_thread2 + 240
16 libSystem.B.dylib 0x97920d41 _pthread_wqthread + 390
17 libSystem.B.dylib 0x97920b86 start_wqthread + 30
)
terminate called after throwing an instance of 'NSException'
Is my syntax for #try #catch wrong? I attempted to add a #catch block for NSRangeException but it seems that's not the right approach (it's not a class).
Also, the server error is caused by [ratable getRemoteId] sometimes returning (null) instead of an integer. This behavior seems pretty unpredictable; if anyone has a clue why ObjectiveResource might be doing that it would be helpful. But I still would like to know how to use #try #catch.
As I now understand it, throwing exceptions should only be done to alert users of your library that they have made a programming error. I am still curious why the syntax I used did not prevent the crash. I know the error was occurring several levels down; but the #try {} #catch {} block should handle all methods called by the methods I call...
At any rate, here is the fixed code, for anyone who wants to fetch scoped objects from a Rails-style restful resource.
+ (NSArray *)findAllFor:(NSObject *)ratable {
NSString *ratingsPath = [NSString stringWithFormat:#"%#%#/%#/%#%#",
[self getRemoteSite],
[ratable getRemoteCollectionName],
[ratable getRemoteId],
[self getRemoteCollectionName],
[self getRemoteProtocolExtension]];
Response *res = [ORConnection get:ratingsPath withUser:[[self class] getRemoteUser]
andPassword:[[self class] getRemotePassword]];
NSError **aError;
if([res isError]) {
*aError = res.error;
return nil;
}
else {
return [self performSelector:[self getRemoteParseDataMethod] withObject:res.body];
}
}
You don't. You fix your code to not throw an exception under these circumstances.