私には2つUITextViewのself.instructionsとがありself.textView、ユーザーが何を選択したかに応じて交互に表示されることになっています。
self.textView私はそのように作成します:
-(void)createSpaceToWrite
{
  [self.instructions removeFromSuperview];
  [self.bar removeFromSuperview];
  [self createNavigationBar:@"Compose" selector:@"displayScreen" withDone:NO];  //This adds a UINavigationBar to the view.
  if (!self.textView)
  {
    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(20, 60, 280, 150)];
  }
  self.textView.backgroundColor = [UIColor whiteColor];
  self.textView.font = [UIFont fontWithName:@"Helvetica Neue" size:14];
  self.textView.text = @"";
  [self.view addSubview:self.textView];
  self.textView.delegate = self;
}
それから私self.instructionsはそのように作成します:
-(void)haikuInstructions
{
  [self.textView removeFromSuperview];
  [self.bar removeFromSuperview];
  [self createNavigationBar:@"Compose" selector:@"displayScreen" withDone:NO];
  if (!self.instructions)
  {
    self.instructions = [[UITextView alloc] initWithFrame:CGRectMake(10, 125, [[UIScreen mainScreen] bounds].size.width - 10, [[UIScreen mainScreen] bounds].size.height)];
  }
  self.instructions.backgroundColor=[UIColor clearColor];
  self.instructions.text = @"Text of instructions";
  self.instructions.editable=NO;
  [self.view addSubview:self.instructions];
  [self resignFirstResponder];
}
ユーザーはself.instructions、背景画像に対して表示されることから始めます。罰金。
ユーザーが切り替えます。self.textView指示テキストが消え、編集可能な白いボックスに置き換えられます。罰金。
ユーザーが元に戻ります。指示テキストが表示されますが、スーパービューから削除したにもかかわらず、白いボックスはまだそこにあります。それだけでなく、それはまだ編集可能であり、ユーザーがそれを編集しようとするとキーボードが表示されます!
私は何が間違っているのですか?
編集:まあ、私は基本的にすべてのコードを廃棄し、クラスを最初からやり直して、すべてをきれいにしようとしました、そして私はもはやこの問題を抱えていません、それでそれはそれに影響を与えていた他の方法の何かであったに違いありません。レッスン:無計画なコーディングは悪いです!