UIImageView instantiation crashes in iOS 8 with EXEC_BAD_ACCESS - ios

I am receiving an "EXEC_BAD_ACCESS" error when I attempt to
instantiate [anImage] in iOS8.
The same code works fine in iOS 7.1 and below.
Any suggestions are greatly appreciated.
//In .h file:
UIImage *img;
//in .m file:
img = [UIImage imageNamed:#"image.png"];
UIImageView *anImage = [[UIImageView alloc] initWithImage:img];
/*
* Here is the stack Trace:
*/
-[__NSCFDictionary _isDecompressing]: unrecognized selector sent to instance 0x16e49740
2014-10-07 08:56:35.319 [AppName] [222:7088] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFDictionary _isDecompressing]: unrecognized
selector sent to instance 0x16e49740'
*** First throw call stack:
(0x27e50e3f 0x35528c8b 0x27e56189 0x27e540a7 0x27d86208 0x2b2faf55 0x1011bb 0x103d27
0xfe759 0x1029d7 0x10060d 0x2b31fd4b 0x2b31fcf1 0x2b30a96b 0x2b32827f 0x2b2e45cd
0x27e175cd 0x27e14c8b 0x27e15093 0x27d63621 0x27d63433 0x2f0d20a9 0x2b34e359 0xe9b05
0x35aa8aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException

Related

Crashes when implementing Geofencing. _NSCFNumber getCString:maxLength:encoding:]: unrecognized selector sent to instance

Not really understand what the exception is and there is no back trace for me to look into it.
- (CLCircularRegion *)regionWithGeotification:(Geotification *)geotification{
NSLog(#"Set region with geotification");
*********
CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:geotification.coordinate radius:geotification.radius identifier:geotification.identifier];
*********
[region setNotifyOnEntry:geotification.eventType==OnEntry];
[region setNotifyOnExit:!region.notifyOnEntry];
NSLog(#"region notify on %d",region.notifyOnExit);
NSLog(#"Done setting region");
return region;
}
What I found out is the crashes start in code above.
2018-11-01 17:25:52.412643+0800 Loud Speaker[12276:1296047] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber getCString:maxLength:encoding:]: unrecognized selector sent to instance 0x85aec1991d2b50a2'
*** First throw call stack: (0x193ff7ef8 0x1931c5a40 0x193f0f154 0x193ffd810 0x193fff4bc 0x19aeb0904 0x19aeb1cbc 0x100d2b024
0x100d2b5ec 0x100d2a478 0x100d2a12c 0x100d29418 0x100d9986c
0x100d449b4 0x100de136c 0x102be7840 0x102be8de4 0x102bf6830
0x193f861bc 0x193f81084 0x193f805b8 0x1961f4584 0x1c0dfcbc8
0x100d93164 0x193a40b94) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Error when using DTCoreText to display HTML code

I use DTHTMLAttributedStringBuilder of DTCoreText to display HTML code in UITableViewCell. But it has an error.
This is my code:
NSDictionary *builderOptions = #{DTDefaultFontFamily: #"Helvetica"};
DTHTMLAttributedStringBuilder *stringBuilder = [[DTHTMLAttributedStringBuilder alloc] initWithHTML:[word[#"name"] dataUsingEncoding:NSUTF8StringEncoding] options:builderOptions documentAttributes:nil];
NSAttributedString *stringAttri = [stringBuilder generatedAttributedString];
cell.textLabel.attributedText = stringAttri;
This is error:
[__NSCFType lineBreakMode]: unrecognized selector sent to instance 0x7f7f7bd1ba60
2015-06-06 11:16:38.898 PhrasalVerb[786:18798] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType lineBreakMode]: unrecognized selector sent to instance 0x7f7f7bd1ba60'
I had the same issue. Turns out I was trying to set the text on a UILabel and not a DTAttributedLabel.

CMDActivityViewController crashing in iOS8

Getting crash in CMDActivityViewController for iOS8.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ArtViewController activityViewController:dataTypeIdentifiersForActivityType:]: unrecognized selector sent to instance 0x7acb0b80'
Solution to this-
In dataTypesForActivityType method of "CMDActivityViewController.m", return nil , instead of the array dataTypes.
Use this Method as it is
- (NSArray *)dataTypesForActivityType:(NSString *)type {
return nil;
}

iOS - NSNotifiction invalid selector

I'm having some trouble understanding why this is happening but for some reason when the NSNotification gets triggered for the second time this happens:
-[UITableViewCel lContentView imageFound:]: unrecognized selector sent to instance 0x1cd837e0 2013-08-12 16:32:24.340 poundtaxi[7483:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCellContentView imageFound:]: unrecognized selector sent to instance 0x1cd837e0'
* First throw call stack: (0x344d92a3 0x3c17e97f 0x344dce07 0x344db531 0x34432f68 0x3442a037 0x34d40599 0xd7d9f 0x33d64145 0x3c59611f 0x3c5954b7 0x3c596dcb 0x344acf3b 0x3441febd 0x3441fd49 0x37fe32eb 0x36335301 0xb963d 0x3c5b5b20) libc++abi.dylib: terminate called throwing an exception
Here is the block of code that gets executed:
-(void)imageFound:(NSNotification *)aNotification {
NSDictionary* userInfo = [aNotification userInfo];
Picture *aPicture = (Picture *) [userInfo objectForKey:#"picture"];
UIImage *image = (UIImage *) [userInfo objectForKey:#"image"];
aPicture.highResPicture = image;
self.count++;
}
It is likely that a registered observer object was released before being removed as an observer. Always remember to remove notification center observers in dealloc.

parent-child unrecognized selector sent to instance

I have a subview, called DataViewController, and a parent viewcontroller, called RootViewController.
Everytime is try to call a function or set a property that is defined in my RootViewController, from my subview, I get these errors:
Error:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIPageViewController
setDetailsDataObject:]: unrecognized selector sent to instance
0x6aa2df0'
Code:
RootViewController.h:
#property (strong, nonatomic) id detailsDataObject;
DataViewController.m:
((RootViewController *)self.parentViewController).detailsDataObject = self.dataObject;
And...
Error:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIPageViewController
showDetails]: unrecognized selector sent to instance 0x6880db0'
Code:
RootViewController.h:
- (void)showDetails;
RootViewController.m:
- (void)showDetails
{
NSLog(#"Hello");
}
DataViewController.m:
[((RootViewController *)self.parentViewController) showDetails];
Does anyone know how to fix these exceptions?
do an Nsaasert statement to check if the self.parentViewController is actually RootViewController instance
NSAssert([self.parentViewController isKindOfClass:[RootViewController class]], #"Not RootViewController");
Try this..correct if there are any spelling mistakes.

Resources