MyView.m code is
#import <UIKit/UIKit.h>
@interface MyView : UIView
{
}
@property (strong, nonatomic)IBOutlet UILabel *aLabel;
but when I open the xib file MyView.xib relates to MyView.h/MyView.m(has set the file owner as Myview, I can not see the IBOutlet aLabel
Is there a way can make UIView also can show IBOutlet aLabel, just like an UIViewController does?
Your comment welcome
Check your Outlets in your view not under the file's owner. See the screenshot.
First, your object is sub-class of UIView, which isn't can be natively relate to a xib. You should use UIViewController instead.
2nd. In case of you want to use an UIView in a xib, here is the way you can have it:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.