0
이 프로그램을 실행할 때 원하는 결과가 나타나지 않습니다. 내가 작성하려고하는 것은 UITextField에서 사용자로부터 텍스트를 가져 오는 속성 프로그램입니다. 그리고 업데이트 버튼을 클릭하면 텍스트 필드 위의 UILabel에 텍스트가 표시됩니다. 일단 내가 텍스트를 편집 할 수있는 버튼을 추가합니다.UITextField에서 속성이 지정된 문자열을 검색하려면 어떻게합니까?
#import "TextChangerViewController.h"
@interface TextChangerViewController()
@property (strong, nonatomic) IBOutlet UITextField *textInput;
@property (strong, nonatomic) IBOutlet UILabel *textOutput;
@property (strong, nonatomic) IBOutlet UIButton *updateButton;
@end
@implementation TextChangerViewController
- (void)updateText:(NSAttributedString *)input
{
[self.textOutput setAttributedText:input];
}
- (IBAction)updateDisplayText:(UIButton *)sender
{
[self updateText:[[NSAttributedString alloc]initWithString:self.textInput.text]];
}
@end
감사합니다. 그 트릭을 했어! – PeterJLyons
@ user2597389, 기뻤습니다! – Firo