MonobjcMonobjc Documented Class Library
NSString Constructor (url, enc, error)
NamespacesMonobjc.FoundationNSStringNSString(NSURL, NSStringEncoding, NSError%)

Returns an NSString object initialized by reading data from a given URL interpreted using a given encoding.

Original signature is '- (id)initWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error'

Available in Mac OS X v10.4 and later.

Declaration Syntax
C#Visual BasicVisual C++
public NSString(
	NSURL url,
	NSStringEncoding enc,
	out NSError error
Public Sub New ( _
	url As NSURL, _
	enc As NSStringEncoding, _
	<OutAttribute> ByRef error As NSError _
	NSURL^ url, 
	NSStringEncoding enc, 
	[OutAttribute] NSError^% error
url (NSURL)
The URL to read.
enc (NSStringEncoding)
The encoding of the file at path.
error (NSError%)
If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in NULL.
Return Value
An NSString object initialized by reading data from url. The returned object may be different from the original receiver. If the URL can’t be opened or there is an encoding error, returns nil.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)