Commits

Anonymous committed 80c76ac

fixed a few typos, expanded the string section a bit

Comments (0)

Files changed (1)

pyobjc/Doc/structure.txt

   Scripts used during building and/or development of PyObjC.
 
 Tools/
-  Scripts that are usefull for users of PyObjC
+  Scripts that are useful for users of PyObjC
 
 Reference counts
 ----------------
 to keep a reference. This includes all factory methods (e.g. 
 [String stringWithCString:"bla"])!
 
-The objc module tries to make the management of reference counts completely
-transparent for the user of the module. This is mostly solved in 
-[de]pythonify_c_value. Additonal code is needed when calling methods that
-transfer ownership of their return value (as described above) and when updating
-a instance variable in an Objective-C object (retain new and release old, 
-in that order). Both are implemented.
+When programming Cocoa in Python, you almost never need to worry about
+reference counts: the objc module makes this completely transparent to user.
+This is mostly implemented in [de]pythonify_c_value. Additonal code is needed
+when calling methods that transfer ownership of their return value (as
+described above) and when updating a instance variable in an Objective-C
+object (retain new and release old, in that order). Both are implemented.
 
 Strings
 -------
 
-We currently automaticly convert from Python strings to NSStrings (and back). 
-This may not be the smartest thing to do because NSString has a number of 
-methods that don't have an equivalent in Python. 
+We currently automatically convert from Python strings to NSStrings (and
+back). An NSString is represented in Python as a subclass of the 'unicode'
+class: objc.pyobjc_unicode. This is a conversion as well as a *reference* to
+the original NSString. The NSString is accessible in Python with the
+.nsstring() method, to allow access to NSString's methods (NSMutableString's
+methods, actually).
 
-Converting a Python string to objective-C and back currently converts the 
-string to Unicode. If may be usefull to try to convert to a normal string
+Converting a Python string to Objective-C and back currently converts the 
+string to Unicode. If may be useful to try to convert to a normal string
 (using [NSString dataUsingEncoding:allowLossyConversion:]) and only return
 a Unicode object if that fails.
 
 When translating from NSString to a Python unicode object (and back) we first 
 translate to a UTF8 encoding. This way we don't have to worry about any
-differences in the representation of Unicode strings in Python and objective-C
-(Python has two different represenations, selection is at compile-time)
+differences in the representation of Unicode strings in Python and Objective-C
+(Python has two different represenations, selection is at compile-time).
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.