Questions tagged [nsexception]

NSException is a Mac Developer Library class used to implement exception handling and contains information about an exception.

NSException is a Mac Developer Library class used to implement exception handling and contains information about an exception.

It is available in OS X v10.0 and later and is declared in NSException.h

259 questions
7
votes
2 answers

How do I know which line of code has caused my iOS app to crash in Xcode 9

I am building an app in Xcode 9 (Swift 4) and it crashes before it even loads completely. I get an error: Thread 1: Signal SIGABRT and libc++abi.dylib: terminating with uncaught exception of type NSException. How do I know which line of code is…
ojassethi
  • 379
  • 1
  • 5
  • 16
6
votes
1 answer

Catching NSKeyedUnarchiver exception

In Swift, NSKeyedUnarchiver.unarchiveObjectWithData(data) will throw an exception if data can't be unarchived. There are some situations where we have no guarantee if that the data is not corrupted, such as when reading from a file. I am not aware…
JP Hribovsek
  • 6,707
  • 2
  • 21
  • 26
6
votes
1 answer

throwing custom exception in objective c

I have following code . . . @try { NSArray * array = [[NSArray alloc] initWithObjects:@"1",@"2",nil]; // the below code will raise an exception [array objectAtIndex:11]; } @catch(NSException *exception) { // now i want to create a…
Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
5
votes
1 answer

Difference between try catch and NSSetUncaughtExceptionHandler

I have tried two methods for catching the exceptions. First one is with a try catch and the second one is with the following code in Appdelegate. void onUncaughtException(NSException* exception) { //save exception details } -…
Mano
  • 670
  • 1
  • 9
  • 28
4
votes
3 answers

Build universal app for iOS 3.0 using Xcode 4.3.x - NSKeyedUnarchiver Exception

Trying to build and debug a universal app for iOS 3.0 using Xcode 4.3.2. I'm getting a NSException from NSKeyedUnarchiver. It seems it may be related to inability to read the main .xib file. I have seen this: iOS and unarchiving xib files --…
windup
  • 455
  • 1
  • 5
  • 17
4
votes
4 answers

What is the lifecycle of an object caught in a @catch block?

When you catch an exception in an ObjC @catch block, what is the lifecycle of that exception object? I know I can safely use it inside the block, but what if I want to use it again after the block, like this? NSException * exception = nil; @try { …
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
4
votes
1 answer

libc abi.dylib: terminating with uncaught exception of type NSException CollectionView

when i run my app, i received this error : 2014-08-11 10:52:10.546 ControlViewTest[918:60b] -[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x8c862f0 2014-08-11 10:52:10.605 ControlViewTest[918:60b]…
Luca Briganti
  • 101
  • 2
  • 4
  • 12
4
votes
2 answers

UnCaughtException handler : decode backtrace symbol

I'm trying to get backtrace symbol like Xcode listout as below *** First throw call stack: ( 0 CoreFoundation 0x018865e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x016098b6…
Mani
  • 17,549
  • 13
  • 79
  • 100
4
votes
2 answers

Terminating app due to uncaught exception 'NSInternalInconsistencyException'

If user touch the UITableView and just Update the TableView for following code [self.myTableView beginUpdates]; [myTableView endUpdates]; then it produce the following crash report. 2013-12-17 17:27:33.446 planobot[12300:a0b] *** Assertion failure…
Rajaram
  • 101
  • 2
  • 7
4
votes
3 answers

NSException raise:format: as the last statement in a method

I have this method: + (MHTwitterParser*)createParser:(NSString*)format { if ([format compare:@"json"] == NSOrderedSame) { return [[MHJsonTwitterParser alloc] init]; } [NSException raise:@"Unknown format" format:@"Unknown format…
Ondrej Peterka
  • 3,349
  • 4
  • 35
  • 49
3
votes
1 answer

Exception handling in entire application

I have a few doubts regarding exception handling in iPhone. Here are they: Suppose I have a chain of methods which are being called one after the other, that is, method A calls method B, which in turn calls method C, which calls method D. Which is…
anshul
  • 846
  • 1
  • 14
  • 32
3
votes
1 answer

NSException callStackSymbols

When exception occurred there is stack trace this kind: 2 CoreFoundation 0x013bd1cc -[__NSArrayI objectAtIndex:] + 236 3 –ò–°–≠–î 0x0000ac76 -[ContentButton handleGesture:] + 326 4 UIKit 0x00de24f2…
Gusev Andrey
  • 446
  • 5
  • 23
3
votes
1 answer

iOS 12 app crash with UIImagePickerController in Landscape mode on iPhone X/XS

I've come across the following, which I believe is a bug in iOS 12. This worked fine in iOS 11.4.1. Try the following. Open a new project in Xcode 10. Add a UI button. Add the following to your PLIST Privacy - Camera Usage Description with some…
Paul S.
  • 1,342
  • 4
  • 22
  • 43
3
votes
2 answers

Why use NSError indrect parameters instead of @try/@catch/@finally

From other questions, I can see that it is recommended that NSError be used for recoverable errors, and @throw/@catch/@finally and NSException should be used for fatal errors. This makes no sense to me. Why would you use NSException for fatal…
Alexander
  • 59,041
  • 12
  • 98
  • 151
3
votes
1 answer

'NSInvalidArgumentException', reason: '-[__NSArrayI leftCapWidth]

I have three views that inherit from the UITableViewController class. The first one shows a list of locations, the second one shows a map with an annotation that represent the location of the row selected at the first view, the last one shows…
Daniel García Baena
  • 1,191
  • 4
  • 19
  • 33
1
2
3
17 18