What iOS version is your iPad running?
ApportionsSegmentWidthsByContent is iOS5 only. Using that property seems to
work on my iPad with iOS5.1 installed...

You could try something like this to avoid 'unknown selector' errors

if (*yourSegmentedControl*.RespondsToSelector(new
MonoTouch.ObjCRuntime.Selector("apportionsSegmentWidthsByContent"))) {

mapTypes.ApportionsSegmentWidthsByContent = true;

}


Roy - i think obj-c "properties" follow that standard where the getter has
the 'name' of the property and the setter has the 'set' prefix...

HTH
cd


On Tue, Mar 20, 2012 at 8:17 AM, Dean Cleaver <
dean.clea...@xceptionsoftware.com> wrote:

> Am trying to set the UISegmentedControl to
> ApportionsSegmentWidthsByContent = true and it crashes on the iPad -
> doesn't crash in the simulator (iPhone) nor on my iPhone devices. Any ideas
> why the difference?
>
> MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.
>  Name: NSInvalidArgumentException Reason: -[UISegmentedControl
> setApportionsSegmentWidthsByContent:]: unrecognized selector sent to
> instance 0x868fc80
>  at
> MonoTouch.UIKit.UISegmentedControl.set_ApportionsSegmentWidthsByContent
> (Boolean value) [0x00000] in <filename unknown>:0
>  at
> KleverLogic.FlashValet.iPhone.Valet.Common.ReceiptViewController.ViewDidLoad
> () [0x00374] in
> /xsl-home/kleverlogic/FlashValet/Mobile/iPhone/Valet/Common/ReceiptViewController.cs:103
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to