5

I wanted to remove the UITextInputAssistantItem that we see while editing the textfield. For which we need to set the leadingBarButtonGroups and trailingBarButtonGroups to empty array. But is resulting in leaks and app crashes, where their is extensive use of UITextField.

How to hide the shortcut bar in iOS9

self.textfield.inputAssistantItem.leadingBarButtonGroups=@[];
self.textfield.inputAssistantItem.trailingBarButtonGroups=@[];

In my current viewController, there is only two textfield and in viewdidLoad the above code, thats it. But, don't know why its resulting in leaks, its a headache for me when interface has many textFields.

enter image description here

From the above image we can see the leaks being generated on textfield beings editing.

If I set it to nil , instead of empty array, still I get the leaks.

Community
  • 1
  • 1
NNikN
  • 3,720
  • 6
  • 44
  • 86
  • I am also seeing this. For me, it manifests as many `UIBarButtonItem` instances that show up in the Xcode Memory Graph Debugger. At this point I think it's simply an iOS bug where it doesn't clean up properly when those arrays are modified. – Jon Colverson Mar 15 '17 at 04:24
  • I've filed a [Radar bug report number 31077141](https://openradar.appspot.com/radar?id=4949205789442048) about this, just in case anyone else comes across this problem. – Jon Colverson Mar 24 '17 at 04:44
  • do you know if it has been solved in new versions? – Jordi Puigdellívol Apr 09 '17 at 15:01
  • Today I tried with Xcode 8.3 , iOS 10.3 and I could not find leaks with the UITextField. – NNikN Apr 09 '17 at 16:17

0 Answers0