Posts

Post not yet marked as solved
0 Replies
265 Views
My current implementation has the following structure: In my implementation of NSXPCListenerDelegate I create the Remote object via the remoteObjectProxy* family of API. I then create the Local object that has a strong reference to Remote Local is then set as exportedObject of the Connection object Did I just create a reference cycle (Connection -> Local -> Remote -> Connection)? The strategy I'm considering right now is to drop the reference to Remote and request it from Connection (unless invalidated) whenever it's needed. But that's a bit inconvenient as I need to somehow refer to Connection from Local. The latter can be solved via a weak (or unowned?) reference from Local to Connection. But then it's important to know whether Connection will retain Local (its exportedObject) until deallocated or until invalidated. Please advise what'd be the best way to proceed.
Posted
by Kentzo.
Last updated
.
Post not yet marked as solved
1 Replies
432 Views
Some headers still use the `out` keyword when declaring out paramaters of Objective-C methods, e.g. `- (BOOL)setWLANChannel:(CWChannel *)channel error:(out NSError **)error NS_AVAILABLE_MAC(10_7);`Is there practical difference when this keyword (qualifier?) is present / abscent for ObjC/ObjC++ (ARC / non-ARC), Swift or AppleScript?The only relevant reference I have found is in Objective-C Automatic Reference Counting doc for Clang, in the section 4.3.4:4. If the parameter is not an Objective-C method parameter marked out, then *p is read, and the result is written into the temporary with primitive semantics.It's not clear to my why "out" makes such a difference.
Posted
by Kentzo.
Last updated
.
Post not yet marked as solved
1 Replies
973 Views
A view defined like this:class SlicedKittyView: NSView { override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) NSImage(named: "SlicedKitty")?.draw(in: bounds, from: NSZeroRect, operation: .sourceOver, fraction: 1.0, respectFlipped: true, hints: nil) } override var isFlipped: Bool { return true } }will always draw an image sliced in Xcode's asset catalog upside down as if respectFlipped is ignored.Removing the slicing in Xcode produces the expected behavior: image is appropriately flipped.Is it expected and if so how to make NSImage's drawing to respect view's flippedness?(filed as 45378703)
Posted
by Kentzo.
Last updated
.
Post not yet marked as solved
6 Replies
773 Views
E.g. in NSView.h all properties are implicitly defined as atomic while clearly having manually implemented accessors (easily seen while debugging). The assembly code does not show anything that would even approximately looks as an attempt for synchronization.Moreover, when defining custom accessors for an atomic property clang does no issue any warnings anymore.Was the language changed to no-op atomic / nonatomic?
Posted
by Kentzo.
Last updated
.