Hi,
If I use this code, everything is fine. I just call
PdfViewerController2.ShowModally(). In there, you see a part that is
commented out. If I use that subclass instead of PSPDFViewController
directly, it fails and I get the exception below.
Can somebody please explain what is going on? The PSPDFViewController is
coming from a bound library.
public class SubclassedController : PSPDFViewController
{
private SubclassedController (PSPDFDocument oDoc) : base(oDoc)
{
}
public static void ShowModally(string sFilename)
{
PSPDFDocument oDoc = new PSPDFDocument(NSUrl.FromFilename(sFilename));
// This is working.
var oController = new PSPDFViewController(oDoc)
{
ModalPresentationStyle =
MonoTouch.UIKit.UIModalPresentationStyle.FullScreen,
ModalTransitionStyle = MonoTouch.UIKit.UIModalTransitionStyle.CoverVertical
} ;
// This isn't!
/*var oController = new SubclassedController(oDoc)
{
ModalPresentationStyle =
MonoTouch.UIKit.UIModalPresentationStyle.FullScreen,
ModalTransitionStyle = MonoTouch.UIKit.UIModalTransitionStyle.CoverVertical
} ;*/
AppDelegateBase.BaseAppDelegate.MainController.PresentViewController(oController,
true, delegate {} );
}
}
{System.ArgumentNullException: Argument cannot be null.
Parameter name: value
at AlexTouch.PSPDFKit.PSPDFViewController.set_PopoverController
(MonoTouch.UIKit.UIPopoverController value) [0x00000] in <filename
unknown>:0
at (wrapper managed-to-native)
MonoTouch.ObjCRuntime.Messaging:void_objc_msgSendSuper (intptr,intptr)
at AlexTouch.PSPDFKit.PSPDFViewController.ReloadData () [0x00000] in
<filename unknown>:0
at (wrapper managed-to-native)
MonoTouch.ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr_bool_IntPtr
(intptr,intptr,intptr,bool,intptr)
at MonoTouch.UIKit.UIViewController.PresentViewController
(MonoTouch.UIKit.UIViewController viewControllerToPresent, Boolean
animated, MonoTouch.Foundation.NSAction completionHandler) [0x0006a] in
/Developer/MonoTouch/Source/monotouch/src/UIKit/UIViewController.g.cs:482
at BrainloopMobile.PdfViewer.PdfViewerController2.ShowModally
(System.String sFilename) [0x00023] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Controllers/PdfViewer/PdfViewerController2.cs:22
at BrainloopMobile.ProgressPreviewItem.PreviewPDF () [0x00000] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Progress/ProgressPreviewItem.cs:446
at BrainloopMobile.ProgressPreviewItem.ProgressEnded () [0x001d0] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Progress/ProgressPreviewItem.cs:428
at BrainloopMobile.Progress.ProgressDelegate.BaseProgressEnded
(PROGRESS_STATUS eStatus) [0x00007] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Progress/Base/ProgressDelegate.cs:55
at
BrainloopMobile.Progress.ModalProgressController+<EndProgress>c__AnonStorey3A.<>m__B3
() [0x0004c] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Progress/Base/ModalProgressController.cs:422
at MonoTouch.UIKit.UIView+<Animate>c__AnonStorey12.<>m__14 (Boolean x)
[0x0000b] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIView.cs:110
at MonoTouch.UIKit.UIView.TrampolineUICompletionHandler (IntPtr block,
Boolean finished) [0x00053] in
/Developer/MonoTouch/Source/monotouch/src/UIKit/UIView.g.cs:1604
at (wrapper native-to-managed)
MonoTouch.UIKit.UIView:TrampolineUICompletionHandler (intptr,int)
at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args,
System.String principalClassName, System.String delegateClassName)
[0x00042] in
/Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at BrainloopMobile.Application.Main (System.String[] args) [0x00000] in
/Users/rene/Documents/Develop/Projects/BrainloopMobile/220/BrainloopMobile/BrainloopMobile/Main.cs:15
}
René
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch