zhiming jiang zhiming jiang - 2 months ago 5
iOS Question

Property not found on object of type "overLayerViewController *" Objective c

I am new to Objective-C. It is a easy problem.

In

overLayerViewController
class:

@property (strong, nonatomic) UIImagePickerController* pickerRef;


In class A:

@property (strong, nonatomic) UIImagePickerController *picker;
...
overLayerViewController *overlay = [[overLayerViewController alloc] initWithNibName:@"overLayerViewController" bundle:nil];
...
overlay.pickerRef = self.picker;


For this last line raise error:


Property pickerRef not found on object of type "overLayerViewController *"


I click
pikerRef
is jumped into
overLayerViewController
class.

Answer

In overLayerViewController.h file do this,

@interface overLayerViewController : YourParentClass

@property (strong, nonatomic) UIImagePickerController* pickerRef;

@end
Comments