Closed forthrin closed 1 year ago
It depends on the data stored in the typedstream. Some common classes like NSString
are translated to Python objects with proper attributes - for example, string.value
to get the contents of a NSString
. But if a class is not recognized by the library (like NSMutableAttributedString
here), it gets translated to a generic representation where you have to access the fields by index - for example attstr.contents[0].value
.
So in your example it should be:
foo = typedstream.unarchive_from_file("typedstream")
string = foo.contents[0].value # NSMutableString('bar')
print(string.value) # bar
Once you have decoded a typestream, how do you access content (ie. "bar")?