38

I get the below debug output when working with some text fields.

UITextField -webView called. This method is no longer supported with the new text architecture

Can someone explain why this is appearing?

I am currently running XCode 5 with iOS 7

rmaddy
  • 314,917
  • 42
  • 532
  • 579
LanceJeffrey
  • 452
  • 5
  • 8
  • 9
    I can consistently reproduce this by creating a new single view project, adding a text field to the storyboard, launching in the simulator, clicking the text field to summon the on-screen keyboard, and then pressing the 'left' key on my (real, physical) keyboard. Are you producing this message in the same way? And can others repro this? – Mark Amery Oct 03 '13 at 13:07
  • ah, yes that is exactly when it happens. So is this just a sim thing? – LanceJeffrey Oct 05 '13 at 08:02
  • I'm not sure. To answer that, you, I, or someone reading this needs to connect a bluetooth keyboard to real iOS device, try repeating the same steps that we're using the trigger the message in the simulator, and see whether they receive it. Unfortunately, I have neither a bluetooth keyboard nor a real iOS device at present, so for the time being that person ain't gonna be me. – Mark Amery Oct 05 '13 at 09:36
  • 3
    Regardless, the message seems to be entirely innocuous - nothing actually appears to break when it is displayed - so I wouldn't worry too much about it. Unlike saner languages and frameworks, sometimes Cocoa Touch seems to just spit out meaningless warnings or lines of logging even when you're doing nothing wrong. As long as I'm sure that I'm not doing anything I'm not supposed to and no user-visible seems to be broken, I just grudgingly ignore these (though it makes me unhappy). – Mark Amery Oct 05 '13 at 09:41
  • @MarkAmery perhaps you shouldn't ignore them. Just because something seems to work doesn't mean you should do it or that it's meaningless. In this case, the warning lets you know that UITextField#webView is deprecated, and will break some time in the future. – radex Nov 25 '13 at 19:18
  • I believe it goes away with sim reset. – zrslv Jan 15 '14 at 09:18
  • @radex As I already noted, the warning here occurs any time you press the left or right arrow with a text field selected. You can confirm this with the reproduction instructions I gave in my first comment. The fault lies with Apple's code, not the app developer's - the instructions to reproduce I gave don't even involve writing any code. Suggesting not to ignore the warning is entirely unhelpful; if you want to use a `UITextField`, you have no choice but to ignore the warning. Since I assume you're not suggesting that nobody should ever use `UITextField`s, I have no idea what your point is. – Mark Amery Feb 08 '14 at 21:15
  • @LanceJeffrey, Finally what was the solution? because am also getting same warning. – Ganesh G Feb 10 '14 at 09:52
  • 2
    The problem still persists in iOS 7.1 / Xcode 5.1. As the problem lies with Apple, there is no solution at this point in time. – ArtSabintsev Mar 17 '14 at 20:56

2 Answers2

20

In previous iOS versions before iOS 7 all UITextFields and UITextViews had underlying UIWebView to show formatted text. Starting from iOS 7 formatted text is drawn using TextKit framework, so -webView property become deprecated.

It seems Apple frameworks still call the webView method internally.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
Roman Kabachenko
  • 513
  • 2
  • 10
1

Resetting the simulator solved the issue for me.

  • XCode Version 5.1.1
  • iOS simulator(s) 7.1
HpTerm
  • 8,151
  • 12
  • 51
  • 67