diff dwt/internal/cocoa/NSString.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSString.d	Sat Aug 09 17:00:02 2008 +0200
+++ b/dwt/internal/cocoa/NSString.d	Tue Aug 19 17:35:17 2008 +0200
@@ -14,7 +14,8 @@
 module dwt.internal.cocoa.NSString;
 
 import tango.core.Vararg : va_list;
-import tango.stdc.stringz : toStringz;
+import tango.stdc.stringz : toString16z;
+import tango.text.convert.Utf : toString16;
 
 import dwt.dwthelper.utils;
 import dwt.internal.cocoa.id;
@@ -127,7 +128,7 @@
 
     public /*const*/char* UTF8String ()
     {
-        return cast(/*const*/char*) OS.objc_msgSend(this.id, OS.sel_UTF8String);
+        return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_UTF8String);
     }
 
     public static NSStringEncoding availableStringEncodings ()
@@ -137,114 +138,114 @@
 
     public bool boolValue ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_boolValue) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_boolValue) !is null;
     }
 
-    public /*const char* */byte* cString ()
+    public /*const*/char* cString ()
     {
-        return cast(/*const char* */byte*) OS.objc_msgSend(this.id, OS.sel_cString);
+        return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_cString);
     }
 
     public NSUInteger cStringLength ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_cStringLength);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_cStringLength);
     }
 
-    public /*const char* */byte* cStringUsingEncoding (NSStringEncoding encoding)
+    public /*const*/char* cStringUsingEncoding (NSStringEncoding encoding)
     {
-        return cast(/*const char* */byte*) OS.objc_msgSend(this.id, OS.sel_cStringUsingEncoding_1, encoding);
+        return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_cStringUsingEncoding_1, encoding);
     }
 
     public bool canBeConvertedToEncoding (NSStringEncoding encoding)
     {
-        return OS.objc_msgSend(this.id, OS.sel_canBeConvertedToEncoding_1, encoding) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_canBeConvertedToEncoding_1, encoding) !is null;
     }
 
     public NSString capitalizedString ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_capitalizedString);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_capitalizedString);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSComparisonResult caseInsensitiveCompare (NSString string)
     {
-        return OS.objc_msgSend(this.id, OS.sel_caseInsensitiveCompare_1, string !is null ? string.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_caseInsensitiveCompare_1, string !is null ? string.id_ : null);
     }
 
     public wchar characterAtIndex (NSUInteger index)
     {
-        return cast(wchar) OS.objc_msgSend(this.id, OS.sel_characterAtIndex_1, index);
+        return cast(wchar) OS.objc_msgSend(this.id_, OS.sel_characterAtIndex_1, index);
     }
 
     public NSString commonPrefixWithString (NSString aString, NSStringCompareOptions mask)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_commonPrefixWithString_1options_1, aString !is null ? aString.id : null, mask);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_commonPrefixWithString_1options_1, aString !is null ? aString.id_ : null, mask);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSComparisonResult compare_ (NSString string)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_compare_1, string !is null ? string.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_compare_1, string !is null ? string.id_ : null);
     }
 
     public NSComparisonResult compare_options_ (NSString string, NSStringCompareOptions mask)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_compare_1options_1, string !is null ? string.id : null, mask);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_compare_1options_1, string !is null ? string.id_ : null, mask);
     }
 
     public NSComparisonResult compare_options_range_ (NSString string, NSStringCompareOptions mask, NSRange compareRange)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_compare_1options_1range_1, string !is null ? string.id : null, mask,
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_compare_1options_1range_1, string !is null ? string.id_ : null, mask,
                 compareRange);
     }
 
     public NSComparisonResult compare_options_range_locale_ (NSString string, NSStringCompareOptions mask, NSRange compareRange, id locale)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_compare_1options_1range_1locale_1, string !is null ? string.id : null, mask,
-                compareRange, locale !is null ? locale.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_compare_1options_1range_1locale_1, string !is null ? string.id_ : null, mask,
+                compareRange, locale !is null ? locale.id_ : null);
     }
 
     public NSUInteger completePathIntoString (/*NSString** */objc.id** outputName, bool flag, /*NSArray** */objc.id** outputArray,
             NSArray filterTypes)
     {
-        return OS.objc_msgSend(this.id, OS.sel_completePathIntoString_1caseSensitive_1matchesIntoArray_1filterTypes_1, outputName, flag, outputArray,
-                filterTypes !is null ? filterTypes.id : null);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_completePathIntoString_1caseSensitive_1matchesIntoArray_1filterTypes_1, outputName, flag, outputArray,
+                filterTypes !is null ? filterTypes.id_ : null);
     }
 
     public NSArray componentsSeparatedByCharactersInSet (NSCharacterSet separator)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_componentsSeparatedByCharactersInSet_1, separator !is null ? separator.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_componentsSeparatedByCharactersInSet_1, separator !is null ? separator.id_ : null);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSArray componentsSeparatedByString (NSString separator)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_componentsSeparatedByString_1, separator !is null ? separator.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_componentsSeparatedByString_1, separator !is null ? separator.id_ : null);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSData dataUsingEncoding_ (NSStringEncoding encoding)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_dataUsingEncoding_1, encoding);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataUsingEncoding_1, encoding);
         return result !is null ? new NSData(result) : null;
     }
 
     public NSData dataUsingEncoding_allowLossyConversion_ (NSStringEncoding encoding, bool lossy)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_dataUsingEncoding_1allowLossyConversion_1, encoding, lossy);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataUsingEncoding_1allowLossyConversion_1, encoding, lossy);
         return result !is null ? new NSData(result) : null;
     }
 
     public NSString decomposedStringWithCanonicalMapping ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decomposedStringWithCanonicalMapping);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decomposedStringWithCanonicalMapping);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString decomposedStringWithCompatibilityMapping ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_decomposedStringWithCompatibilityMapping);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decomposedStringWithCompatibilityMapping);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public static NSStringEncoding defaultCStringEncoding ()
@@ -254,276 +255,276 @@
 
     public NSString description ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_description);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_description);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public double doubleValue ()
     {
-        return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+        return OS.objc_msgSend_fpret(this.id_, OS.sel_doubleValue);
     }
 
     public NSStringEncoding fastestEncoding ()
     {
-        return cast(NSStringEncoding) OS.objc_msgSend(this.id, OS.sel_fastestEncoding);
+        return cast(NSStringEncoding) OS.objc_msgSend(this.id_, OS.sel_fastestEncoding);
     }
 
-    public /*const char* */byte* fileSystemRepresentation ()
+    public /*const*/char* fileSystemRepresentation ()
     {
-        return cast(/*const char* */byte*) OS.objc_msgSend(this.id, OS.sel_fileSystemRepresentation);
+        return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_fileSystemRepresentation);
     }
 
     public float floatValue ()
     {
-        return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+        return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_floatValue);
     }
 
     public bool getBytes (void* buffer, NSUInteger maxBufferCount, NSUInteger* usedBufferCount, NSStringEncoding encoding, NSStringEncodingConversionOptions options,
             NSRange range, NSRangePointer leftover)
     {
-        return OS.objc_msgSend(this.id, OS.sel_getBytes_1maxLength_1usedLength_1encoding_1options_1range_1remainingRange_1, buffer, maxBufferCount,
+        return OS.objc_msgSend(this.id_, OS.sel_getBytes_1maxLength_1usedLength_1encoding_1options_1range_1remainingRange_1, buffer, maxBufferCount,
                 usedBufferCount, encoding, options, range, leftover) !is null;
     }
 
     public void getCString_ (/*char* */byte* bytes)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCString_1, bytes);
+        OS.objc_msgSend(this.id_, OS.sel_getCString_1, bytes);
     }
 
     public void getCString_maxLength_ (/*char* */byte* bytes, NSUInteger maxLength)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1, bytes, maxLength);
+        OS.objc_msgSend(this.id_, OS.sel_getCString_1maxLength_1, bytes, maxLength);
     }
 
     public bool getCString_maxLength_encoding_ (/*char* */byte* buffer, NSUInteger maxBufferCount, NSStringEncoding encoding)
     {
-        return OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1encoding_1, buffer, maxBufferCount, encoding) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_getCString_1maxLength_1encoding_1, buffer, maxBufferCount, encoding) !is null;
     }
 
     public void getCString_maxLength_range_remainingRange_ (/*char* */byte* bytes, NSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1range_1remainingRange_1, bytes, maxLength, aRange, leftoverRange);
+        OS.objc_msgSend(this.id_, OS.sel_getCString_1maxLength_1range_1remainingRange_1, bytes, maxLength, aRange, leftoverRange);
     }
 
     public void getCharacters_ (wchar* buffer)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCharacters_1, buffer);
+        OS.objc_msgSend(this.id_, OS.sel_getCharacters_1, buffer);
     }
 
     public void getCharacters_range_ (wchar* buffer, NSRange aRange)
     {
-        OS.objc_msgSend(this.id, OS.sel_getCharacters_1range_1, buffer, aRange);
+        OS.objc_msgSend(this.id_, OS.sel_getCharacters_1range_1, buffer, aRange);
     }
 
     public bool getFileSystemRepresentation (/*char* */byte* cname, NSUInteger max)
     {
-        return OS.objc_msgSend(this.id, OS.sel_getFileSystemRepresentation_1maxLength_1, cname, max) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_getFileSystemRepresentation_1maxLength_1, cname, max) !is null;
     }
 
     public void getLineStart (NSUInteger* startPtr, NSUInteger* lineEndPtr, NSUInteger* contentsEndPtr, NSRange range)
     {
-        OS.objc_msgSend(this.id, OS.sel_getLineStart_1end_1contentsEnd_1forRange_1, startPtr, lineEndPtr, contentsEndPtr, range);
+        OS.objc_msgSend(this.id_, OS.sel_getLineStart_1end_1contentsEnd_1forRange_1, startPtr, lineEndPtr, contentsEndPtr, range);
     }
 
     public void getParagraphStart (NSUInteger* startPtr, NSUInteger* parEndPtr, NSUInteger* contentsEndPtr, NSRange range)
     {
-        OS.objc_msgSend(this.id, OS.sel_getParagraphStart_1end_1contentsEnd_1forRange_1, startPtr, parEndPtr, contentsEndPtr, range);
+        OS.objc_msgSend(this.id_, OS.sel_getParagraphStart_1end_1contentsEnd_1forRange_1, startPtr, parEndPtr, contentsEndPtr, range);
     }
 
     public bool hasPrefix (NSString aString)
     {
-        return OS.objc_msgSend(this.id, OS.sel_hasPrefix_1, aString !is null ? aString.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_hasPrefix_1, aString !is null ? aString.id_ : null) !is null;
     }
 
     public bool hasSuffix (NSString aString)
     {
-        return OS.objc_msgSend(this.id, OS.sel_hasSuffix_1, aString !is null ? aString.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_hasSuffix_1, aString !is null ? aString.id_ : null) !is null;
     }
 
     public NSUInteger hash ()
     {
-        return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_hash);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_hash);
     }
 
     public NSString initWithBytes (/*const*/void* bytes, NSUInteger len, NSStringEncoding encoding)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBytes_1length_1encoding_1, bytes, len, encoding);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithBytes_1length_1encoding_1, bytes, len, encoding);
         return result !is null ? this : null;
     }
 
     public NSString initWithBytesNoCopy (/*const*/void* bytes, NSUInteger len, NSStringEncoding encoding, bool freeBuffer)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithBytesNoCopy_1length_1encoding_1freeWhenDone_1, bytes, len, encoding, freeBuffer);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithBytesNoCopy_1length_1encoding_1freeWhenDone_1, bytes, len, encoding, freeBuffer);
         return result !is null ? this : null;
     }
 
-    public NSString initWithCString_ (/*const char* */byte* bytes)
+    public NSString initWithCString_ (/*const*/char* bytes)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1, bytes);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCString_1, bytes);
         return result !is null ? this : null;
     }
 
-    public NSString initWithCString_encoding_ (/*const char* */byte* nullTerminatedCString, NSStringEncoding encoding)
+    public NSString initWithCString_encoding_ (/*const*/char* nullTerminatedCString, NSStringEncoding encoding)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1encoding_1, nullTerminatedCString, encoding);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCString_1encoding_1, nullTerminatedCString, encoding);
         return result !is null ? this : null;
     }
 
-    public NSString initWithCString_length_ (/*const char* */byte* bytes, NSUInteger length)
+    public NSString initWithCString_length_ (/*const*/char* bytes, NSUInteger length)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1length_1, bytes, length);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCString_1length_1, bytes, length);
         return result !is null ? this : null;
     }
 
-    public NSString initWithCStringNoCopy (/*const char* */byte* bytes, NSUInteger length, bool freeBuffer)
+    public NSString initWithCStringNoCopy (/*const*/char* bytes, NSUInteger length, bool freeBuffer)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCStringNoCopy_1length_1freeWhenDone_1, bytes, length, freeBuffer);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCStringNoCopy_1length_1freeWhenDone_1, bytes, length, freeBuffer);
         return result !is null ? this : null;
     }
 
     public NSString initWithCharacters (/*const*/wchar* characters, NSUInteger length)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCharacters_1length_1, characters, length);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCharacters_1length_1, characters, length);
         return result !is null ? this : null;
     }
 
     public NSString initWithCharactersNoCopy (/*const*/wchar* characters, NSUInteger length, bool freeBuffer)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCharactersNoCopy_1length_1freeWhenDone_1, characters, length, freeBuffer);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCharactersNoCopy_1length_1freeWhenDone_1, characters, length, freeBuffer);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfFile_ (NSString path)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path !is null ? path.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfFile_1, path !is null ? path.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfFile_encoding_error_ (NSString path, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1encoding_1error_1, path !is null ? path.id : null, enc, error);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfFile_1encoding_1error_1, path !is null ? path.id_ : null, enc, error);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfFile_usedEncoding_error_ (NSString path, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1usedEncoding_1error_1, path !is null ? path.id : null, enc, error);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfFile_1usedEncoding_1error_1, path !is null ? path.id_ : null, enc, error);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfURL_ (NSURL url)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url !is null ? url.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfURL_1, url !is null ? url.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfURL_encoding_error_ (NSURL url, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1encoding_1error_1, url !is null ? url.id : null, enc, error);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfURL_1encoding_1error_1, url !is null ? url.id_ : null, enc, error);
         return result !is null ? this : null;
     }
 
     public NSString initWithContentsOfURL_usedEncoding_error_ (NSURL url, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1usedEncoding_1error_1, url !is null ? url.id : null, enc, error);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfURL_1usedEncoding_1error_1, url !is null ? url.id_ : null, enc, error);
         return result !is null ? this : null;
     }
 
     public NSString initWithData (NSData data, NSStringEncoding encoding)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithData_1encoding_1, data !is null ? data.id : null, encoding);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithData_1encoding_1, data !is null ? data.id_ : null, encoding);
         return result !is null ? this : null;
     }
 
     public NSString initWithFormat_ (NSString initWithFormat)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1, initWithFormat !is null ? initWithFormat.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFormat_1, initWithFormat !is null ? initWithFormat.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSString initWithFormat_arguments_ (NSString format, va_list argList)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1arguments_1, format !is null ? format.id : null, argList);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFormat_1arguments_1, format !is null ? format.id_ : null, argList);
         return result !is null ? this : null;
     }
 
     public NSString initWithFormat_locale_ (NSString format, id locale)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1locale_1, format !is null ? format.id : null,
-                locale !is null ? locale.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFormat_1locale_1, format !is null ? format.id_ : null,
+                locale !is null ? locale.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSString initWithFormat_locale_arguments_ (NSString format, id locale, va_list argList)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1locale_1arguments_1, format !is null ? format.id : null,
-                locale !is null ? locale.id : null, argList);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFormat_1locale_1arguments_1, format !is null ? format.id_ : null,
+                locale !is null ? locale.id_ : null, argList);
         return result !is null ? this : null;
     }
 
     public NSString initWithString (NSString aString)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, aString !is null ? aString.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithString_1, aString !is null ? aString.id_ : null);
         return result !is null ? this : null;
     }
 
     public NSString initWithUTF8String (/*const*/char* nullTerminatedCString)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithUTF8String_1, nullTerminatedCString);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithUTF8String_1, nullTerminatedCString);
         return result !is null ? this : null;
     }
 
     public int intValue ()
     {
-        return cast(int) OS.objc_msgSend(this.id, OS.sel_intValue);
+        return cast(int) OS.objc_msgSend(this.id_, OS.sel_intValue);
     }
 
     public NSInteger integerValue ()
     {
-        return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_integerValue);
+        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_integerValue);
     }
 
     public bool isAbsolutePath ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_isAbsolutePath) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isAbsolutePath) !is null;
     }
 
     public bool isEqualToString (NSString aString)
     {
-        return OS.objc_msgSend(this.id, OS.sel_isEqualToString_1, aString !is null ? aString.id : null) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_isEqualToString_1, aString !is null ? aString.id_ : null) !is null;
     }
 
     public NSString lastPathComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_lastPathComponent);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_lastPathComponent);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSUInteger length ()
     {
-        return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_length);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_length);
     }
 
     public NSUInteger lengthOfBytesUsingEncoding (NSStringEncoding enc)
     {
-        return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_lengthOfBytesUsingEncoding_1, enc);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_lengthOfBytesUsingEncoding_1, enc);
     }
 
     public NSRange lineRangeForRange (NSRange range)
     {
         NSRange result;
-        OS.objc_msgSend_struct(result, this.id, OS.sel_lineRangeForRange_1, range);
+        OS.objc_msgSend_struct(&result, this.id_, OS.sel_lineRangeForRange_1, &range);
         return result;
     }
 
     public NSComparisonResult localizedCaseInsensitiveCompare (NSString string)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_localizedCaseInsensitiveCompare_1, string !is null ? string.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_localizedCaseInsensitiveCompare_1, string !is null ? string.id_ : null);
     }
 
     public NSComparisonResult localizedCompare (NSString string)
     {
-        return cast(NSComparisonResult) OS.objc_msgSend(this.id, OS.sel_localizedCompare_1, string !is null ? string.id : null);
+        return cast(NSComparisonResult) OS.objc_msgSend(this.id_, OS.sel_localizedCompare_1, string !is null ? string.id_ : null);
     }
 
     public static NSString localizedNameOfStringEncoding (NSStringEncoding encoding)
@@ -535,147 +536,147 @@
     public static id localizedStringWithFormat (NSString localizedStringWithFormat)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_localizedStringWithFormat_1,
-                localizedStringWithFormat !is null ? localizedStringWithFormat.id : null);
+                localizedStringWithFormat !is null ? localizedStringWithFormat.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public long longLongValue ()
     {
-        return cast(long) OS.objc_msgSend(this.id, OS.sel_longLongValue);
+        return cast(long) OS.objc_msgSend(this.id_, OS.sel_longLongValue);
     }
 
-    public /*const char* */byte* lossyCString ()
+    public /*const*/char* lossyCString ()
     {
-        return cast(/*const char* */byte*) OS.objc_msgSend(this.id, OS.sel_lossyCString);
+        return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_lossyCString);
     }
 
     public NSString lowercaseString ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_lowercaseString);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_lowercaseString);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSUInteger maximumLengthOfBytesUsingEncoding (NSStringEncoding enc)
     {
-        return OS.objc_msgSend(this.id, OS.sel_maximumLengthOfBytesUsingEncoding_1, enc);
+        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maximumLengthOfBytesUsingEncoding_1, enc);
     }
 
     public NSRange paragraphRangeForRange (NSRange range)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphRangeForRange_1, range);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_paragraphRangeForRange_1, range);
         return result;
     }
 
     public NSArray pathComponents ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_pathComponents);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathComponents);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSString pathExtension ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_pathExtension);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathExtension);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public static NSString pathWithComponents (NSArray components)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_pathWithComponents_1, components !is null ? components.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_pathWithComponents_1, components !is null ? components.id_ : null);
         return result !is null ? new NSString(result) : null;
     }
 
     public NSString precomposedStringWithCanonicalMapping ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_precomposedStringWithCanonicalMapping);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_precomposedStringWithCanonicalMapping);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString precomposedStringWithCompatibilityMapping ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_precomposedStringWithCompatibilityMapping);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_precomposedStringWithCompatibilityMapping);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public id propertyList ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_propertyList);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_propertyList);
         return result !is null ? new id(result) : null;
     }
 
     public NSDictionary propertyListFromStringsFileFormat ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_propertyListFromStringsFileFormat);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_propertyListFromStringsFileFormat);
         return result !is null ? new NSDictionary(result) : null;
     }
 
     public NSRange rangeOfCharacterFromSet_ (NSCharacterSet aSet)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1, aSet !is null ? aSet.id : null);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfCharacterFromSet_1, aSet !is null ? aSet.id_ : null);
         return result;
     }
 
     public NSRange rangeOfCharacterFromSet_options_ (NSCharacterSet aSet, NSStringCompareOptions mask)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1options_1, aSet !is null ? aSet.id : null, mask);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfCharacterFromSet_1options_1, aSet !is null ? aSet.id_ : null, mask);
         return result;
     }
 
     public NSRange rangeOfCharacterFromSet_options_range_ (NSCharacterSet aSet, NSStringCompareOptions mask, NSRange searchRange)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1options_1range_1, aSet !is null ? aSet.id : null, mask, searchRange);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfCharacterFromSet_1options_1range_1, aSet !is null ? aSet.id_ : null, mask, searchRange);
         return result;
     }
 
     public NSRange rangeOfComposedCharacterSequenceAtIndex (NSUInteger index)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfComposedCharacterSequenceAtIndex_1, index);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfComposedCharacterSequenceAtIndex_1, index);
         return result;
     }
 
     public NSRange rangeOfComposedCharacterSequencesForRange (NSRange range)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfComposedCharacterSequencesForRange_1, range);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfComposedCharacterSequencesForRange_1, range);
         return result;
     }
 
     public NSRange rangeOfString_ (NSString aString)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1, aString !is null ? aString.id : null);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfString_1, aString !is null ? aString.id_ : null);
         return result;
     }
 
     public NSRange rangeOfString_options_ (NSString aString, NSStringCompareOptions mask)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1, aString !is null ? aString.id : null, mask);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfString_1options_1, aString !is null ? aString.id_ : null, mask);
         return result;
     }
 
     public NSRange rangeOfString_options_range_ (NSString aString, NSStringCompareOptions mask, NSRange searchRange)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1range_1, aString !is null ? aString.id : null, mask, searchRange);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfString_1options_1range_1, aString !is null ? aString.id_ : null, mask, searchRange);
         return result;
     }
 
     public NSRange rangeOfString_options_range_locale_ (NSString aString, NSStringCompareOptions mask, NSRange searchRange, NSLocale locale)
     {
         NSRange result;
-        OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1range_1locale_1, aString !is null ? aString.id : null, mask,
-                searchRange, locale !is null ? locale.id : null);
+        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeOfString_1options_1range_1locale_1, aString !is null ? aString.id_ : null, mask,
+                searchRange, locale !is null ? locale.id_ : null);
         return result;
     }
 
     public NSStringEncoding smallestEncoding ()
     {
-        return OS.objc_msgSend(this.id, OS.sel_smallestEncoding);
+        return cast(NSStringEncoding) OS.objc_msgSend(this.id_, OS.sel_smallestEncoding);
     }
 
     public static NSString string ()
@@ -686,131 +687,131 @@
 
     public NSString stringByAbbreviatingWithTildeInPath ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAbbreviatingWithTildeInPath);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAbbreviatingWithTildeInPath);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByAddingPercentEscapesUsingEncoding (NSStringEncoding enc)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAddingPercentEscapesUsingEncoding_1, enc);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAddingPercentEscapesUsingEncoding_1, enc);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByAppendingFormat (NSString stringByAppendingFormat)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingFormat_1,
-                stringByAppendingFormat !is null ? stringByAppendingFormat.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAppendingFormat_1,
+                stringByAppendingFormat !is null ? stringByAppendingFormat.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByAppendingPathComponent (NSString str)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingPathComponent_1, str !is null ? str.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAppendingPathComponent_1, str !is null ? str.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByAppendingPathExtension (NSString str)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingPathExtension_1, str !is null ? str.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAppendingPathExtension_1, str !is null ? str.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByAppendingString (NSString aString)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingString_1, aString !is null ? aString.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByAppendingString_1, aString !is null ? aString.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByDeletingLastPathComponent ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByDeletingLastPathComponent);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByDeletingLastPathComponent);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByDeletingPathExtension ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByDeletingPathExtension);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByDeletingPathExtension);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByExpandingTildeInPath ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByExpandingTildeInPath);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByExpandingTildeInPath);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByFoldingWithOptions (NSStringCompareOptions options, NSLocale locale)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByFoldingWithOptions_1locale_1, options, locale !is null ? locale.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByFoldingWithOptions_1locale_1, options, locale !is null ? locale.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByPaddingToLength (NSUInteger newLength, NSString padString, NSUInteger padIndex)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByPaddingToLength_1withString_1startingAtIndex_1, newLength,
-                padString !is null ? padString.id : null, padIndex);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByPaddingToLength_1withString_1startingAtIndex_1, newLength,
+                padString !is null ? padString.id_ : null, padIndex);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByReplacingCharactersInRange (NSRange range, NSString replacement)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingCharactersInRange_1withString_1, range,
-                replacement !is null ? replacement.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByReplacingCharactersInRange_1withString_1, range,
+                replacement !is null ? replacement.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByReplacingOccurrencesOfString_withString_ (NSString target, NSString replacement)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingOccurrencesOfString_1withString_1, target !is null ? target.id : null,
-                replacement !is null ? replacement.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByReplacingOccurrencesOfString_1withString_1, target !is null ? target.id_ : null,
+                replacement !is null ? replacement.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByReplacingOccurrencesOfString_withString_options_range_ (NSString target, NSString replacement, NSStringCompareOptions options,
             NSRange searchRange)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingOccurrencesOfString_1withString_1options_1range_1,
-                target !is null ? target.id : null, replacement !is null ? replacement.id : null, options, searchRange);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByReplacingOccurrencesOfString_1withString_1options_1range_1,
+                target !is null ? target.id_ : null, replacement !is null ? replacement.id_ : null, options, searchRange);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByReplacingPercentEscapesUsingEncoding (NSStringEncoding enc)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingPercentEscapesUsingEncoding_1, enc);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByReplacingPercentEscapesUsingEncoding_1, enc);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByResolvingSymlinksInPath ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByResolvingSymlinksInPath);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByResolvingSymlinksInPath);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByStandardizingPath ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByStandardizingPath);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByStandardizingPath);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString stringByTrimmingCharactersInSet (NSCharacterSet set)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringByTrimmingCharactersInSet_1, set !is null ? set.id : null);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringByTrimmingCharactersInSet_1, set !is null ? set.id_ : null);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
-    public static id static_stringWithCString_ (/*const char* */byte* bytes)
+    public static id static_stringWithCString_ (/*const*/char* bytes)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1, bytes);
         return result !is null ? new NSString(result) : null;
     }
 
-    public static id static_stringWithCString_encoding_ (/*const char* */byte* cString, NSStringEncoding enc)
+    public static id static_stringWithCString_encoding_ (/*const*/char* cString, NSStringEncoding enc)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1encoding_1, cString, enc);
         return result !is null ? new NSString(result) : null;
     }
 
-    public static NSString static_stringWithCString_length_ (/*const char* */byte* bytes, NSUInteger length)
+    public static NSString static_stringWithCString_length_ (/*const*/char* bytes, NSUInteger length)
     {
         objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1length_1, bytes, length);
         return result !is null ? new NSString(result) : null;
@@ -824,60 +825,61 @@
 
     public static NSString stringWith (String str)
     {
-        char[] chars = str.dup;
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCharacters_1length_1, chars.toStringz(), chars.length);
+        char[] chars = new char[str.length];
+        str.getChars(0, chars.length, chars, 0);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCharacters_1length_1, toString16z(chars.toString16()), chars.length);
         return result !is null ? new NSString(result) : null;
     }
 
     public static id static_stringWithContentsOfFile_ (NSString path)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1, path !is null ? path.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1, path !is null ? path.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_stringWithContentsOfFile_encoding_error_ (NSString path, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1encoding_1error_1, path !is null ? path.id : null, enc,
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1encoding_1error_1, path !is null ? path.id_ : null, enc,
                 error);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_stringWithContentsOfFile_usedEncoding_error_ (NSString path, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1usedEncoding_1error_1, path !is null ? path.id : null,
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1usedEncoding_1error_1, path !is null ? path.id_ : null,
                 enc, error);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_stringWithContentsOfURL_ (NSURL url)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1, url !is null ? url.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1, url !is null ? url.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_stringWithContentsOfURL_encoding_error_ (NSURL url, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1encoding_1error_1, url !is null ? url.id : null, enc,
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1encoding_1error_1, url !is null ? url.id_ : null, enc,
                 error);
         return result !is null ? new id(result) : null;
     }
 
     public static id static_stringWithContentsOfURL_usedEncoding_error_ (NSURL url, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1usedEncoding_1error_1, url !is null ? url.id : null, enc,
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1usedEncoding_1error_1, url !is null ? url.id_ : null, enc,
                 error);
         return result !is null ? new id(result) : null;
     }
 
     public static id stringWithFormat (NSString stringWithFormat)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_1, stringWithFormat !is null ? stringWithFormat.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_1, stringWithFormat !is null ? stringWithFormat.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
     public static id stringWithString (NSString string)
     {
-        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithString_1, string !is null ? string.id : null);
+        objc.id result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithString_1, string !is null ? string.id_ : null);
         return result !is null ? new id(result) : null;
     }
 
@@ -889,53 +891,53 @@
 
     public NSArray stringsByAppendingPaths (NSArray paths)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_stringsByAppendingPaths_1, paths !is null ? paths.id : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringsByAppendingPaths_1, paths !is null ? paths.id_ : null);
         return result !is null ? new NSArray(result) : null;
     }
 
     public NSString substringFromIndex (NSUInteger from)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_substringFromIndex_1, from);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_substringFromIndex_1, from);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString substringToIndex (NSUInteger to)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_substringToIndex_1, to);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_substringToIndex_1, to);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString substringWithRange (NSRange range)
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_substringWithRange_1, range);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_substringWithRange_1, range);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public NSString uppercaseString ()
     {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_uppercaseString);
-        return result is this.id ? this : (result !is null ? new NSString(result) : null);
+        objc.id result = OS.objc_msgSend(this.id_, OS.sel_uppercaseString);
+        return result is this.id_ ? this : (result !is null ? new NSString(result) : null);
     }
 
     public bool writeToFile_atomically_ (NSString path, bool useAuxiliaryFile)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path !is null ? path.id : null, useAuxiliaryFile) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_writeToFile_1atomically_1, path !is null ? path.id_ : null, useAuxiliaryFile) !is null;
     }
 
     public bool writeToFile_atomically_encoding_error_ (NSString path, bool useAuxiliaryFile, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1encoding_1error_1, path !is null ? path.id : null, useAuxiliaryFile, enc,
+        return OS.objc_msgSend(this.id_, OS.sel_writeToFile_1atomically_1encoding_1error_1, path !is null ? path.id_ : null, useAuxiliaryFile, enc,
                 error) !is null;
     }
 
     public bool writeToURL_atomically_ (NSURL url, bool atomically)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url !is null ? url.id : null, atomically) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_writeToURL_1atomically_1, url !is null ? url.id_ : null, atomically) !is null;
     }
 
     public bool writeToURL_atomically_encoding_error_ (NSURL url, bool useAuxiliaryFile, NSStringEncoding enc, /*NSError** */objc.id** error)
     {
-        return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1encoding_1error_1, url !is null ? url.id : null, useAuxiliaryFile, enc, error) !is null;
+        return OS.objc_msgSend(this.id_, OS.sel_writeToURL_1atomically_1encoding_1error_1, url !is null ? url.id_ : null, useAuxiliaryFile, enc, error) !is null;
     }
 
 }