~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/maccore/src/Foundation/NSError.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
// Copyright 2010, Novell, Inc.
 
3
// Copyright 2011, 2012 Xamarin Inc
3
4
//
4
5
// Permission is hereby granted, free of charge, to any person obtaining
5
6
// a copy of this software and associated documentation files (the
40
41
 
41
42
        public partial class NSError : NSObject {
42
43
#if !COREBUILD
43
 
                [Obsolete ("Creating NSErrors without arguments can cause your application to crash unexpectedly if you return it back to Objective-C")]
44
 
                [Export ("init")]
45
 
                public NSError () : base (NSObjectFlag.Empty)
 
44
                [Advice ("Always specify a domain and error code when creating an NSError instance")]
 
45
                public NSError () : this (new NSString ("Invalid .ctor used"), 0, null)
46
46
                {
47
 
                        Debug.WriteLine ("Warning: you created an NSError without a domain, this can crash your application if you return this to Objective-C");
48
 
                        if (IsDirectBinding) {
49
 
                                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, Selector.Init);
50
 
                        } else {
51
 
                                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, Selector.Init);
52
 
                        }
 
47
                        Debug.WriteLine ("Warning: you created an NSError without specifying a domain");
53
48
                }
54
49
                
55
50
                public static NSError FromDomain (NSString domain, int code)