```no_run ##[macro_use]externcrateobjc; #useobjc::rc::{autoreleasepool,StrongPtr}; #fnmain(){ // StrongPtr will release the object when dropped letobj=unsafe{ StrongPtr::new(msg_send![class!(NSObject),new]) };
// Cloning retains the object an additional time letcloned=obj.clone(); autoreleasepool(||{ // Autorelease consumes the StrongPtr, but won't // actually release until the end of an autoreleasepool cloned.autorelease(); });
// These tests use NSObject, which isn't present for GNUstep #[cfg(all(test, any(target_os = "macos", target_os = "ios")))] mod tests { use runtime::Object; usesuper::StrongPtr; usesuper::autoreleasepool;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.