我的视图控制器包含一个 UIImageView 和一个 UITextView 下面。这是我的代码:
#import <UIKit/UIKit.h>
@interface DescriptionViewController : UIViewController
@property (nonatomic, strong) IBOutlet UIImageView *descriptionImage;
@property (nonatomic, strong) IBOutlet UITextView *descriptionText;
@property (nonatomic, strong) NSString *text;
@property (nonatomic, strong) NSString *image;
@end
@interface DescriptionViewController ()
@end
@implementation DescriptionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.descriptionText = [[UITextView alloc] init];
self.descriptionImage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:self.image]]];
self.descriptionText.text = self.text;
NSLog(@"%@", self.descriptionText.text);
}
@end
我的代码没有显示在 textview 中,但我可以使用 NSLog 打印它。
可能是什么问题呢 ?