In my iPhone only app, I have an InputAccessoryView appear whenever the user selects a textfield. The accessory view provides buttons which aid the user (undo/redo etc).

It works fantastically on the simulator and on iPhone devices.

However, out of the blue, the Input Accessory View is not appearing on the iPad. I've made no changes to the code regarding the views; I've even rolled back to a version that I know displayed the accessory view correctly.

I was wondering if anyone else has come across this behaviour before / would know why this is happening?

EDIT

I've seen this accross all of my iphone projects running on the ipad. I made a fresh project which only contains 1 view, a UITextField and override the Input Accessory View and I'm still seeing nothing.

Nothing too complex, on the iPhone just returns a blue bar above the keyboard.

I've reinstalled Mono, MonoDevelop, Monotouch and the iOS SDK multiple times to no avail. Apps that I've downloaded from the store still show the Input Accessory View, so I'm beginning to wonder if it's an issue with my Monotouch/iOS SDK combo? I'm using Monotouch 3.1.3 personal and 4.1 iOS SDK - version 2.6 of Mono. I'm going to try updating to version 2.8 of Mono.

The thing I don't understand is why it would work previously then all of a sudden just stop working?

When I'm deploying the code on the iPad, I'm selecting "Rebuild all", then uploading to the device. It doesn't matter if I pick either Release/Debug as a build, both yield the same result.

EDIT 2

If I subclass a UITextField and override the InputAccessoryView within that subclass, then the view appears on the iPad. This means that the InputAccessoryView which is being overriden in the View class isn't being assigned to the Textfield on the ipad.

Can you elaborate on what you do when you deploy your code on the iPad? Did you try to run the iPhone app (unmodified) on the iPad? Or did you set up a new iPad project, copied the code and then observe that the behavior is different? Could you post a minimal code/setup that reproduces the behavior?
–
user8472Nov 2 '10 at 11:58

3 Answers
3

My first suggestion is to reset the device in iTunes. You may have done so already, but just in case you did not, please do it first (since it's quick and easy to do).

If that didn't help: To identify if it is a problem with Monotouch and/or the iOS SDK could you repeat what you did above using only Cocoa Touch?

I.e., start a View-based app in XCode, add one UITextField in Interface Builder and connect it to the controller. Here is a corresponding Objective-C code to do it:

Instance variables in your controller (add to the @interface section in the <controllername>.h file):

IBOutlet UITextField *text;
UIView *accessory;

Hook up the UITextField in Interface Builder with the text outlet and then add the following implementation of viewDidLoad to the controller (the @implementation section in the <controllername>.m file):

This is awesome - thank you! I've done it and I'm getting an accessory view on the ipad, which leads me to believe this is a Monotouch related issue.
–
LukeNov 4 '10 at 14:35

@Luke: Yes, since you said it used to work before I suspect that an update to Monotouch (and/or to iOS and/or the SDK) has introduced the bug you are seeing. I guess the best solution is to file a bug report with Novell and the temporary workaround to use an "empty" subclass (as you described above).
–
user8472Nov 4 '10 at 15:23

I had the same issue where a UITextView contained within a UIView would show the accessory bar on the simulator but not on the iPhone or iPad.

I'm doing some strange things with BeginFirstResponder to allow tapping anywhere in the larger parent area (containing a label and the text field) and activating the contained field and suspected this was involved. I added code in the parent UIView to override the InputAccessoryView and have it return the the value from the child UITextView and this fixed.

I suspect that Monotouch has an issue routing the event to the wrong object and my fix resolved it.

I'm displaying it as follows: UIViewController with two UITextFields hooked into it via IB. In the UIViewController class I override UIView InputAccessoryView (I'm creating the view within the override, as seen in my question). I found that this displayed the views. I tried keeping a reference, on the iPhone it succeeded, but on the ipad Foo.track was null. So the override isn't being called on the iPad but is on the iPhone? - forgot to say, thank you for the help, much appreciated : )
–
LukeNov 4 '10 at 14:56

Sounds like you found the root of the problem, that your override is not being called. Why that happens is a mystery that only you can unwind as you have the source ;-)
–
miguel.de.icazaNov 4 '10 at 15:31