Re: [Pyobjc-dev] NSString & mutability
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-02-04 20:38:13
|
On Tuesday, Feb 4, 2003, at 15:21 US/Eastern, Just van Rossum wrote: > Someone on comp.sys.mac.programmer.help suggested a trick to find out > whether an NS[CF]String is mutable or not: by comparing classForCoder > to > NSString. Nifty. > > This allowed me to patch objc_support.m so it only converts immutable > strings to Python strings: Nice hack, but.... What about all the code that might return a mutable string depending on how the developer exercises the API? Are you willing to assume that every getter and setter that internally makes a immutable copy of the set string value? i.e. that... ... [fooObject setMyNameIs: someRandomMutableString]; return [fooObject myNameIs] ... ... that -myNameIs will return an immutable string? See this message -- it is still quite relevant. Mike Ferris is one of the guys who helped write the AppKit and Project Builder. http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/001886.html |