I am trying to Unhide some buttons in a ViewControl using a button in a secondary VC.
On my researches I found out that I have to use a "Delegation action".
I have created two classes named VC1 -> VC2
VC1.h contains:
#import <UIKit/UIKit.h>
@protocol CustomDelegate <NSObject>
-(void)hideUnhidebutton:(BOOL)value;
@end
@interface VC1 : NSObject <CustomDelegate>
@property (strong, nonatomic) IBOutlet UIButton *buttonToUnhide;
@end
in VC1.m I have implemented the function that unhide the button:
#import "VC1.h"
@interface VC1 ()
@end
@implementation VC1
-(void)hideUnhidebutton:(BOOL)value
{
[self.buttonToUnhide setHidden:value];
}
After this I have added add delegate variable as property in VC2.h
#import <UIKit/UIKit.h>
#import "VC1.h"
@interface VC2 : UIViewController
@property (nonatomic, strong) id<CustomDelegate> delegatePpty;
@end
And in the end I called the delegate function in VC2.m
#import "VC2.h"
@interface VC2 ()
@end
@implementation VC2
-(void)someAction
{
[self.delegatePpty hideUnhidebutton:NO];//Call the delegate method to execute
}
there are no issue but when I try to launch the project it just crash after loading showing this issue:
Here the project file:
http://salvonostrato.com//ex/xcode5/TEST2.zip
I am not sure what to do next... please help.
//EDITED
IT keeps crashing showing: