我在 Objective-C 类文件 (Test.m) 中声明了一个 UIView
@property (nonatomic,strong) UIView *Scene1;
在 StoryBoard 中,当我尝试使引用导出指向我在 objective-C 文件中设置的 View 时,场景 1 未显示在列表中。
注意: 1. 我已经将 View 指向了正确的类文件。 2.都是UIView类型
这是头文件(Test.h)的代码
#import "JSMessagesViewController.h"
@interface Test : JSMessagesViewController
@end
这是类文件Test.m的代码
#import "Test.h"
#import "MessageData.h"
@interface DeerView () <JSMessagesViewDelegate, JSMessagesViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate,UIActionSheetDelegate>
@property (strong, nonatomic) NSMutableArray *messageArray;
@property (nonatomic,strong) UIImage *willSendImage;
@property (nonatomic,strong) UIView *Scene1;
@end
@implementation DeerView
@synthesize messageArray, NameInput, Scene1, Scene2, Scene3, Scene4, Name;
...
@end
我是一名高中生,也是一名仍在学习更多知识的年轻开发人员。希望你能帮助我解决问题。
最佳答案
更改您的导出声明并将其标记为导出
@property (nonatomic, weak) IBOutlet UIView *Scene1;
如果您不想将其从 subview 中删除,则无需将其声明为强属性。
关于ios - 找不到在 Objective-C 文件中声明的引用 socket ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41226087/