[MonoTouch] Third argument Presentviewcontroller
Robert Jordan
robertj at gmx.net
Wed Dec 14 04:56:41 EST 2011
Hi,
you can check the iOS version at run-time:
if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0)) {
// call API for iOS >= 5.0
} else {
// alternative
}
Robert
On 14.12.2011 06:35, Xy wrote:
> Hi Robert,
>
> Would still be great if you could tell us how to call such a method
> correctly. There are other similar methods in iOS 5API, such as
> DismissViewController. We probably should start using them soon.
>
> Thanks,
> XY
>
>
> Robert Jordan wrote
>>
>> On 31.10.2011 20:25, Andreas Ploetzeneder wrote:
>>> i get
>>> MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.
>>> Name: NSInvalidArgumentException Reason: -[S3G.MySplitViewController
>>> presentViewController:animated:completion:]: unrecognized selector sent
>>> to
>>> instance 0x72d3300
>>
>> This is an iOS 5 API. You want PresentModalViewController.
>>
>> Robert
>>
>>
>>>
>>> 2011/10/31 Robert Jordan<robertj@>
>>>
>>>> On 31.10.2011 19:56, Andreas Ploetzeneder wrote:
>>>>> null is not allowed,i get a crash if i make third argument null.... but
>>>> for
>>>>> what do i need it ?
>>>>
>>>> From the docs I've posted below: "The completion handler is called
>>>> after the viewDidAppear: method is called on the presented view
>>>> controller."
>>>>
>>>>> so third argument can be "delegate{};"?
>>>>
>>>> Yes.
>>>>
>>>> splitviewcontroller.PresentViewController(
>>>> someController,
>>>> true,
>>>> delegate {}
>>>> );
>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2011/10/31 Robert Jordan<robertj@>
>>>>>
>>>>>> On 31.10.2011 18:48, Andreas Ploetzeneder wrote:
>>>>>>> Hi,
>>>>>>> i want to call splitviewcontroller.PresentViewController ,
>>>>>>> splitviewcontroller is an UISplitviewcontroller
>>>>>>>
>>>>>>> what is the third argument, i have to call? can u show me an example?
>>>>>>
>>>>>> It's a simple delegate, so you could pass `delegate {}' as the 3rd
>>>>>> parameter, if null isn't allowed. The docs say otherwise:
>>>>>>
>>>>>>
>>>>>>
>>>> http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW75
>>>>>>
>>>>>> So please file a bug if passing delegate {} is fixing your issue.
>>>>>>
>>>>>> Robert
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> MonoTouch mailing list
>>>>>> MonoTouch at .ximian
>>>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> MonoTouch mailing list
>>>> MonoTouch at .ximian
>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> MonoTouch mailing list
>> MonoTouch at .ximian
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Third-argument-Presentviewcontroller-tp3956583p4193760.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
More information about the MonoTouch
mailing list