priore

NSError from NSException

Feb 5th, 2014
681
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (NSError*)NSErrorFromException:(NSException*)exc
  2. {
  3.     NSMutableDictionary * info = [NSMutableDictionary dictionary];
  4.     [info setValue:exc.name forKey:@"MONExceptionName"];
  5.     [info setValue:exc.reason forKey:@"MONExceptionReason"];
  6.     [info setValue:exc.callStackReturnAddresses forKey:@"MONExceptionCallStackReturnAddresses"];
  7.     [info setValue:exc.callStackSymbols forKey:@"MONExceptionCallStackSymbols"];
  8.     [info setValue:exc.userInfo forKey:@"MONExceptionUserInfo"];
  9.    
  10.     return [[NSError alloc] initWithDomain:@"MyAppName" code:-1969 userInfo:info];
  11. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×