2016-12-19 29 views
0

我聲明在Objective-C類文件(Test.m)找不到在Objective-C文件中聲明的引用奧特萊斯

@property (nonatomic,strong) UIView *Scene1; 

在故事板,一個UIView當我試圖做一個基準出口指向我在Objective-C文件中設置的視圖,場景1不顯示在列表中。

注意:1.我已經將視圖指向正確的類文件。 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 

我一位高中生和一位仍在學習更多東西的年輕開發人員。希望你能幫助我的問題。

回答

1

更改您的出口申報並標記爲出口

@property (nonatomic, weak) IBOutlet UIView *Scene1; 

而你並不需要把它聲明爲一個強大的屬性,如果你不從子視圖中刪除。

+0

這有幫助!我想我可能忘了IBOutlet是能夠從Views中指向的對象。感謝LOOOOOT! –