I am having trouble testing equality on the Views that are set up in my project.
This is a long post, please bear with me. I have 3 separate views set up as part of the same XIB.

Each view is connected to File Owner (UIViewController) via an IBOutlet



The owner itself is a UIViewController
@interface PuzzleViewController : UIViewController {
Inside the FileOwner views are declared as:
IBOutlet Puzzle1 *p1;
IBOutlet Puzzle2 *p2;
IBOutlet Puzzle3 *p3;
@property (nonatomic, retain) IBOutlet Puzzle1 *p1;
@property (nonatomic, retain) IBOutlet Puzzle2 *p2;
@property (nonatomic, retain) IBOutlet Puzzle3 *p3;
Additionally i have
UIView *currentPuzzleView;
@property (nonatomic, retain) UIView *currentPuzzleView;
In .m file, upon initialization, i declare current view to be p1
[self setCurrentPuzzleView:p1];
Later, i would like to check if current view is in fact p1. This comparison fails.
if ([[self currentPuzzleView] isEqual:p1]) {
Additionally this fails as well
if ([self currentPuzzleView] == p1) {
Why is this?
Because you are using different classes for the equality test (UIView and Puzzle1). Your currentPuzzleView should be a pointer to one of those three classes Puzzle1 Puzzle2 Puzzle3. If you definitely need to use three different classes for those puzzle views, try adding tags to them and change
to
set it to 1 upon
viewDidLoad:and change the tag to appropriate when different views are selected.