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
1
vote
0 answers

What is the correct way to raise an NSException?

I've created a macro that, if compiling in debug mode, will check to make sure the method has been called by a subclass with the same name (to stop external classes from calling it). If that is not the case, it will throw an exception: #ifdef…
jowie
  • 8,028
  • 8
  • 55
  • 94
1
vote
1 answer

How to subclass NSException and use in a better way?

I would like to subclass NSException and use it in my app for the application specific errors or exceptions. Is it right way to do so? If YES, how to do it in a better way. If NO, why it is not the right way and whats the alternate for it?. Please…
Easwaramoorthy Kanagaraj
  • 3,925
  • 8
  • 36
  • 62
1
vote
2 answers

How to present view controller properly?

I have a pretty simple application with a couple of UIViewControllers (say VC_A and VC_B). Every screen has a button that allows to switch to another screen (no UINavigation is used). App schedules a local notification, which, when expired,…
Asahi
  • 13,378
  • 12
  • 67
  • 87
1
vote
1 answer

how to NSException get localized NSLocalizedDescription

I got an Exception Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x1fd68a20 {NSErrorFailingURLStringKey=http://mac-mini.local/~user/restcon/auth?username=&password=,…
kaala
  • 536
  • 1
  • 5
  • 15
1
vote
1 answer

Is it a good practice to subclass from NSException for app-specific exceptions?

Is it a good practice to subclass from NSException for app-specific exceptions? That way everything is centralized one class for easier management. e.g. @interface AppException : NSException + (AppException *)InvalidSomething; + (AppException…
Boon
  • 40,656
  • 60
  • 209
  • 315
1
vote
1 answer

symbolization with atos

MyApplication creates a personalized crash report using the NSException instance. The app retrieves the callStackSymbols array and adds them to a text file. If you notice on the crash report, instead of getting a line like this: libsqlite3.dylib …
the Reverend
  • 12,305
  • 10
  • 66
  • 121
1
vote
1 answer

NSSetUncaughtExceptionHandler not working on Lion 10.7.3

The following simple code on the app's delegate on a new cocoa test project. void onUncaughtException(NSException *exception){ NSLog(@"Caught!!! %@", exception); } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { …
the Reverend
  • 12,305
  • 10
  • 66
  • 121
0
votes
3 answers

I'm getting SIGABRT when I try to load a video (objective-c)

So the problem I am having is that when I try to load a video this way: -(void) viewDidLoad { MyManager *sharedManager = [MyManager sharedManager]; [super viewDidLoad]; NSString *tempName = sharedManager.vidName; NSLog(@"%@", tempName); //This is…
Sean Smyth
  • 1,509
  • 3
  • 25
  • 43
0
votes
2 answers

NSException rethrowing with wrong stack in the debugger

When I crash (for reasons I understand; that's not the problem) when I try to do something Cocoa isn't okay with, such as calling a method that doesn't exist or attempting to insert nil into a set, the debugger shows the stack from main() to…
Jared Pochtar
  • 4,925
  • 2
  • 29
  • 39
0
votes
2 answers

Objective-C Problems While Transitioning Between Views

I'm having issues transitioning between views and need some help. This is somewhat conviluted so bear with me please. I have a UINavigationController called JobsNavController. The first view in JobsNavController holds a UITableViewController…
sadmicrowave
  • 39,964
  • 34
  • 108
  • 180
0
votes
1 answer

App terminate due to - uncaught exception 'NSGenericException',

I got the below error while fetching some data from sever. While fetching data, i m displaying an custom alert view with activity indicator. Alert is using main thread while data fetching is done by NSThread. This problem occurs only at some time,…
JiteshW
  • 2,195
  • 4
  • 32
  • 61
0
votes
2 answers

throwing an exception in an objective-c method when a required input parameter is nil?

Noting the general guidance re use of exceptions in objective-c (e.g. throwing an exception in objective-c/cocoa) I'm still not quite sure for this case: is throwing an exception in an objective-c method when a required input parameter is nil best…
Greg
  • 34,042
  • 79
  • 253
  • 454
0
votes
3 answers

NSRangeException and arc4random

Alright, so I'm using arc4random to get a random image out of an array, the code for this is as follows: //ray is the array that stores my images int pic = arc4random() % ray.count; tileImageView.image = [ray objectAtIndex:pic-1]; NSLog(@"Index of…
kopproduction
  • 465
  • 5
  • 19
0
votes
3 answers

Assertion failure in -[UILabel setFont:]

I am getting this exception on setting a font of UILabel in iOS 3.1.2 but its running fine in iOS 4, *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil' The code…
0
votes
0 answers

unrecognised selector sent to instance when attaching GLFW Cocoa Window to IPlugView (VST3SDK)

I'm doing some work with the Steinberg VST3SDK and have bumped into an error I don't really understand: [GLFWWindow window]: unrecognized selector sent to instance 0x7fe10430a830 2022-12-22 08:11:08.981 MyHost[1593:20791] *** Terminating app due to…
sh93
  • 11
  • 2