Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7836579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:13:00+00:00 2026-06-02T14:13:00+00:00

My iPhone app (based on the Single View Application of Xcode) has a UITextView

  • 0

My iPhone app (based on the “Single View Application” of Xcode) has a UITextView (say: myTextView) that I want the user to be able to edit. I was setting it to editable, and all was working fine (I didn’t even have to invoke becomeFirstResponder).

Then I moved it in another UIWindow (say: newWindow) (on top of the main/root/key one that is called self.window (of the Single View App.)).

But now, when I click on the UITextView, the keyboard does not show.

Everything works if I do this:

[myTextView setEditable:YES];
[myTextView becomeFirstResponder]; // ugly…and I do not need it, but I added it just in case…

[self.window addSubview:newWindow];

but the keyboard is shown immediately (since I set becomeFirstResponder) that is not nice.
But if I remove the becomeFirstResponder line, the keyboard does not show at all!

If I move the [self.window addSubview:newWindow] line above, then no matter what I do, the keyboard is not activated…

[self.window addSubview:newWindow]; // this is how it should be… but,
[myTextView setEditable:YES];
[myTextView becomeFirstResponder]; // even when I enter this, it’s not working 🙁

I tried [newWindow makeKeyAndVisible] nothing. I tried to add a touch delegate and detect a touch (or a gesture) on the UITextView, they work (I get the NSLog message I included), but again, no keyboard. I even tried to add another field (of the main window) on top of newWindow (so as to have a main window element on top), still no luck…

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:13:01+00:00Added an answer on June 2, 2026 at 2:13 pm

    You shouldn’t add a UIWindow as a subview. Instead, windows are shown either by calling -[UIWindow makeKeyAndVisible], or -[UIWindow setHidden:NO] if you don’t want it to receive key events.

    It’s rare that you need to use multiple windows though. Just using a normal UIView add adding that as a subview will do in many cases.

    EDIT: I had a confusing remark before about “assigning to a screen”. UIWindow has a property “screen”, which you can assign to if you want to display the window on another screen than the main screen. You don’t need to care about that for your use case, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a view-based iPhone app that has the following flow: search ->
I create a brand new Single View Application iPhone app in Xcode 4.2, it
I have a View based application for iPhone/iPod that plays audio, having a VU
I want to change the currency symbols in iPhone app based on user's localization.
I am trying to create multiple views in my view-based iPhone app in Xcode
I have a simple iphone app that's based on the CrashLanding sample app. So
I have an iPhone app that is based on a navigation controller. I have
I have a tab-based iPhone app where I want to increase the perceived start-up
I have an OCR based iPhone app that takes in grayscale images and thresholds
I have an iphone app that I built based off a tutorial (for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.