[MonoTouch] iPod Touch unhappy with use of RightBarButtonItems

Jason Awbrey jason at awbrey.net
Fri Dec 16 20:53:07 EST 2011


I *think* the ability to handle multiple rightbarbuttons is new in iOS 5.
 In prior versions you could only have a single rightbarbutton.

however, my brain has already checked out for the weekend, so I might be
wrong

JA

On Fri, Dec 16, 2011 at 7:50 PM, jlindborg <jlindborg2000 at gmail.com> wrote:

> Went out and snagged a iPod Touch to test with and I'm glad I did - I have
> several views I put two buttons in the RightBarButtonItems colleciton on
> and
> it crashes my app on the iPod, but works fine on my iPad as well as all
> versions of the simulator I tried.  Not sure if this is a poor idea or not.
> Code looks like this in the ViewDidLoad:
>
> ========
> UIBarButtonItem _addButton = new UIBarButtonItem (UIImage.FromBundle
> ("Images/more_24.png"), UIBarButtonItemStyle.Plain,
> Handle_AddNewPrivateRecordingClicked);
>
> UIBarButtonItem _editButton = new UIBarButtonItem (UIImage.FromBundle
> ("Images/delete_24.png"), UIBarButtonItemStyle.Plain, Handle_EditMode);
>
> NavigationItem.RightBarButtonItems = new UIBarButtonItem[]
> {_addButton,_editButton};
> ========
>
> on the iPod in debug mode it kicks this out:
>
> 2011-12-16 17:42:38.467 MultiPageTest[207:707] -[UINavigationItem
> setRightBarButtonItems:]: unrecognized selector sent to instance 0x7188e70
> log: Unhandled exception at the applicaiton
> level:MonoTouch.Foundation.MonoTouchException: Objective-C exception
> thrown.
> Name: NSInvalidArgumentException Reason: -[UINavigationItem
> setRightBarButtonItems:]: unrecognized selector sent to instance 0x7188e70
>  at MonoTouch.UIKit.UINavigationItem.set_RightBarButtonItems
> (MonoTouch.UIKit.UIBarButtonItem[] value) [0x00000] in <filename unknown>:0
>
> So... am I doing something ill advised and should change my ways or is this
> a bug?
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/iPod-Touch-unhappy-with-use-of-RightBarButtonItems-tp4207021p4207021.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111216/696cb4b5/attachment-0001.html 


More information about the MonoTouch mailing list