'+[UIImage didReceiveMemoryWarning:]: unrecognized selector sent to class 0x1b6eba078 - ios

Iam using uimageview in tableview, before adding uiimage view in tableview the Application get crash due to this problem ( +[UIImage didReceiveMemoryWarning:]: unrecognized selector sent to class 0x1a0bd1798 ).

didReceiveMemoryWarning is UIViewController method, so, suppose, you pass UIImage instance to place, where UIViewController expected

Related

Terminating app due to uncaught exception [UIImageView _isResizable]

I'm getting an exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView _isResizable]: unrecognized selector sent to instance 0x7fe01fd0d470'
I just assigned an image to the imageView inside a custom cell using storyboard.
The code is clean. It doesn't have any warnings or errors.
Two reason of this error.
If you want to assign image write.
cell.image=[UIImage imagenamed:#"Name of your image "];
and another reason of this error is you can cut the link of imageView to the outlet.
Again make a new outlet and then check now imageView is working.
i think this will help u.
there may be two or more outlet references to one imageView which makes ambiguous
Please see once the name of image in swift file and StroryBoard. Compare them they must be same.
Also check the identifier of Cell.

how to set up a selector from a different UIView object for UITapGestureRecognizer

This should be straight forward but I am having some issues with this.
I have an UIView A which has a function A. I create a Selector for function A in UIView A.
SEL littleSelector = #selector(handleTapButton1);
I create UIView B and pass this selector to UIView B constructor and save it in UIView B. I set up UITapGestureRecognizer in UIView B and I assign selector from UIViewA "littleSelector" as its action. I get an exception = unrecognized selector sent to instance. I know selectors are not really function pointers but look up numbers. I also made sure that UIView A is retained.
Any ideas ?
A selector needs to be paired with an appropriate target. If you supply a selector for A and a target instance of B you will have this kind of issue. You need to set the target properly to A so the method represented by the selector is called on the right class instance.

unrecognized selector sent to instance 0x7ff971e1f920

When I run my iOS app on the iPhone 6 simulator on Xcode 6.1 it stops on this line:
[cell configure:[feeds objectAtIndex:indexPath.row]];
Error:
'-[UITableViewCell configure:]: unrecognized selector sent to instance 0x7ff971e1f920'
Presumably you've defined a custom cell subclass with a configure: method.
Your subclass isn't being used - that message means you're calling the method on a plain UITableViewCell.
The most common cause of this is forgetting to set the cell class in the storyboard. Otherwise, you'll need to show how you're creating cell.
You have called the configure method on a UITableViewCell instance, but this class doesn't have that method. I suspect that you meant to instantiate your own UITableViewCell subclass that does have that method.

Error when moving view Controller

I get an error saying
*** Assertion failure in -[HatsViewController loadView], /SourceCache/UIKit/UIKit-2380.17/UICollectionViewController.m:104
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UICollectionViewController loadView] loaded the "FCD-ki-UFO-view-1vb-8P-s3C" nib but didn't get a UICollectionView.'
*** First throw call stack:
(0x3467c2a3 0x3c36097f 0x3467c15d 0x34f51ab7 0x368aaa95 0x364a346d 0x3652f353 0x36570d11 0x3656ffe7 0x366923ef 0x3656f0c5 0x3656f077 0x3656f055 0x3656e90b 0x3656ee01 0x364975f1 0x36484801 0x3648411b 0x3818b5a3 0x3818b1d3 0x34651173 0x34651117 0x3464ff99 0x345c2ebd 0x345c2d49 0x3818a2eb 0x364d8301 0xc0dfd 0x3c797b20)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Why does this happen and how can I fix it?
When you’re using a UICollectionViewController, the view outlet needs to be connected to a UICollectionView in your storyboard; if it’s a UIView of another class, it’ll crash.
check HatsViewController.h is inherited from UICollectionViewController but you have connected it view in your storyboard. Either it must be subclass of UIViewController or it is connected to UICollectionView in your storyboard.

Popovers in UITableView

I would like to display popovers with UITableView's as content (this works) on some button presses and then get the selected item as string as buttontitle or some textview text. I've found a few example on how to do this with protocols but still get an error.
My code:
In popoverViewController.h
#protocol popoverViewControllerDelegate <NSObject>
-(void)getRowText:(NSString *)string;
#end
I declare an id delegate2 variable and set its property to:
#property(nonatomic,assign) id<popoverViewControllerDelegate> delegate2;
In the popoverViewController.m file I synthesize the variable, and in didSelectRowAtIndexPath method I have this, and this line seems to cause the error I`m having:
[self.delegate2 getRowText:[someArray objectAtIndex:indexPath.row];
In mainViewController.m I add the popoverViewControllerDelegate to the ViewControllers protocol and have its header file imported. And then have some code in the -(void)getRowText: method which doesnt get called.
UIPopovers and such are set up as they work as needed, problem arises when I press a row in the tableview. I get the
Terminating app due to uncaught
exception
'NSInvalidArgumentException', reason:
'* -[UIPopoverViewController
getRowText:]: unrecognized selector
sent to instance 0x57ca80'
Could anyone give some advice with this?
Finally found the error and cant believe how silly I/it was.
I had a viewController.delegate2 = self. line with period instead of a semicolon, I wonder why it compiled tho.

Resources