Protocol extensions returning self

2016-02-04 Thread Charles Jenkins
I’m trying to learn how to use protocols and extensions to factor out redundant function bodies. Supposedly in a protocol, “Self” is the class implementing the protocol. So it seems to me that extension methods should be able to have a return type of Self so they can return self, and thus have

Weird Problem, is this an XCode Bug?

2016-02-04 Thread Dave
XCode 7.2 (7C68). Mac OS X (not iOS). Hi, I sent the following message to the XCode List, but now I’m wondering if there is a bug in my code that is causing this weird behaviour? What could cause then Debugger to think that a regular object is an Array/Dictionary? The object in question is su

Location of XCode of Apple Developer Site?

2016-02-04 Thread Dave
Hi, Could someone please point me to where I can download XCode from the Apple Developer site? I think my XCode is hosed and I’d like to re-install it - I don’t have time to wait for the App Store….. Thanks a lot Dave ___ Cocoa-dev mailing list (Coc

Re: Location of XCode of Apple Developer Site?

2016-02-04 Thread Bill Cheeseman
Dave, You'll find Xcode 7.2.1 (February 1, 2016) here: . > On Feb 4, 2016, at 10:03 AM, Dave wrote: > > Could someone please point me to where I can download XCode from the Apple > Developer site? -- Bill Cheeseman - wjcheese...@comcast.net

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
You're not alone. I see this every so often and just make do with the console view to see what I need (po is your friend). If you have more than one project open, you might try closing those before restarting Xcode. Another flake that Xcode has is putting the wrong project's source file in the D

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Dave
Jeez, really? I need a broken debugger like a hole in the dead at the moment. Any idea what causes it and how to get rid of it? Using “po” won’t help as it’s a custom object, I need to look at the properties. Any ideas how I can do this? I was wondering if it could be caused by a bug in my code

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
The command po is for objects and p is for intrinsics; just add a typedef on those. If what you mean by properties are actually instance variables, use the -> operator on the object. po [anObject aPropertyThatIsAnObject] p (BOOL )[anObject aBoolMethod] p anObject->aBooliVar Unless you've modifi

Re: Easier way to make NSView subclasses refresh on a property change?

2016-02-04 Thread Motti Shneor
>> On 3 Feb 2016, at 5:05 PM, Graham Cox > > wrote: >> >> Is there a good way to automate this for a given set of properties? > > > BTW, it would be really great if this were an extension of property > attributes, e.g: > > @property (nonatomic, assign, refresh) B

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Dave
Hi Again, I’m trying to debug a network of interwoven objects. To do all that with “po” will take at least 10 times longer. The only other way I can think to fix it, it to write a method on the Custom Object subclass that Logs the Properties. Doing it that would would probably take 3 or 4 time

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
Writing your own description or debugDescription method is a great way to view a large custom object, since you can format it the way you like. For an example, check out Apple's tech note about debugging magic (both OS X and iOS versions of it) and look at theirs for a view hierarchy description

Different visualization of NSTableView row in Yosemite and El Capitan

2016-02-04 Thread Juanjo Conti
Hi there! We have a desktop app that has an NSTableView with rows and some cells are TextFields. In Yosemite it looks ok (the text is vertically centered): http://snag.gy/2B1WM.jpg Another developer built it in El Capital and text fields in the rows look off-centered vertically: http://snag.gy/yr

Re: Protocol extensions returning self

2016-02-04 Thread Quincey Morris
On Feb 4, 2016, at 05:03 , Charles Jenkins wrote: > > am I tilting at a windmill? The problem is that the protocol in unspecific as to what kind of types it can be applied to, and your intentions don’t work if the type is a struct**. In fact, you only apply it to classes (Fluent.Sequence and

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Sandor Szatmari
I have traversed object hierarchies in the debugger using predicates and KVC in GDB described below. (Last tested in Xcode 4.6.3 compiler Apple LLVM 4.2) For an array, something like... (typed in mail ) po (NSArray*)[arr filteredArrayUsingPredicate:(NSPredicate*)[NSPredicate predicateWithFormat:

Re: Different visualization of NSTableView row in Yosemite and El Capitan

2016-02-04 Thread Juanjo Conti
More info: A version compiled in El Capitan and running on Yosemite looks ok. A version compiled in Yosemite and running on El Capital looks off-centered. On Thu, Feb 4, 2016 at 2:58 PM, Juanjo Conti wrote: > Hi there! We have a desktop app that has an NSTableView with rows and some > cells are

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Dave
There are 100’s/1000’s of nodes, would take forever, I’m writing a self-test method now….. Shame about the debugger in XCode, still at least we have lots of lovely animations to make up for it, thanks Apple. I’m wondering if the cause of my problems is to do with archiving/unarchiving as I’ve

Re: [NSThread callStackSymbols] weirdness

2016-02-04 Thread Jens Alfke
> On Feb 3, 2016, at 11:28 PM, Trygve Inda wrote: > > why do I get to > see 3 method calls in my own app in the first example, but only the last call > in the second example? Tail-call optimization, probably. If the last thing a function does is call another function, the optimizer will chang

Re: Protocol extensions returning self

2016-02-04 Thread Jens Alfke
FYI, the swift-users list is a great place to ask questions about the Swift language (that don’t involve platform APIs.) Lots of expert users there, including Chris Lattner and other members of Apple’s Swift team. https://lists.swift.org/mailman/listinfo/swift-users

Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
Hi, I have an object LTWNetwork that contains the following properties: NSMutableArray* pNetworkArray; //Contains an Hierarchical Array of LTWNetworkNode’s NSMutableDictionary* pNetworkDict //Contains a Hierarchical Dict o

Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
Meant to Add that pNetworkParentNode is defined as weak - does this make a difference? If I make it strong, it would cause a cycle? All the Best Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Jens Alfke
> On Feb 4, 2016, at 11:02 AM, Dave wrote: > > However, after I unarchive this object, the pNetworkParentNode property is > nil. Is this after the entire object graph has been unarchived, or is it inside your -initWithCoder: method? > I was wondering about copyWithZone, should I use copy fo

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
Hi Jens, > On 4 Feb 2016, at 19:21, Jens Alfke wrote: > > >> On Feb 4, 2016, at 11:02 AM, Dave > > wrote: >> >> However, after I unarchive this object, the pNetworkParentNode property is >> nil. > > Is this after the entire object graph has been unarchived,

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
>> Meant to Add that pNetworkParentNode is defined as weak - does this make a >> difference? If I make it strong, it would cause a cycle? > > Hm. I don’t know how weak ivars interact with unarchiving. They should work > OK, since the unarchiver has a collection that points to every object that’

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Jens Alfke
> On Feb 4, 2016, at 12:10 PM, Dave wrote: > > I’m not sure how to get around this, is what I am doing supposed to work? I > mean, should backlinks get saved/restored correctly when you > archive/unarchive? Yes, they should. What happens if you experimentally change them to strong? Obviously

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
> On 4 Feb 2016, at 20:19, Jens Alfke wrote: > > >> On Feb 4, 2016, at 12:10 PM, Dave > > wrote: >> >> I’m not sure how to get around this, is what I am doing supposed to work? I >> mean, should backlinks get saved/restored correctly when you >> archive/unarchi

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
I meant: After it’s created, the: ParentNode.child[n].parent == ParentNode, after restore this is not true. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moder

auto-layout and rotated UILabels

2016-02-04 Thread Steve Christensen
Our UI design calls for a UILabel rotated 90° CCW. When I originally started implementing several months ago, I tried going the auto-layout route but ran out of time without a solution, so I went back to manual layout, calculating the size of the label in code then adjusting the frames of the la

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
I’m wondering what would happen if I put the LTWNetwork into an Array and then archived that, on unarchive, I’d get an array back and I’d just fish the network out of that? I’m a bit tired at the moment and don’t want change too many things at once and wondered if that would be a good idea or no

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Dave
> I’m wondering what would happen if I put the LTWNetwork into an Array and > then archived that, on unarchive, I’d get an array back and I’d just fish the > network out of that? I’m a bit tired at the moment and don’t want change too > many things at once and wondered if that would be a good id

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Richard Charles
> On Feb 4, 2016, at 7:59 AM, Dave wrote: > What could cause then Debugger to think that a regular object is an > Array/Dictionary? The debugger is not perfect. You may need to use logging. > The object in question is subclass from a custom base class. Have you properly designed your custom

Re: auto-layout and rotated UILabels

2016-02-04 Thread Quincey Morris
On Feb 4, 2016, at 13:01 , Steve Christensen wrote: > > it looks like the width of the embedding view is set to the text width of the > UILabel instead of the text height, which is borne out by the view geometry Can you use a custom class for the embedding view and override its ‘intrinsicConte

How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
Suppose one wants to do a task in an NSView only once it has no drawRect calls pending. Is there any way to tell, for a particular NSView, if there are any drawing events coming up? Whether, that is, the view is up to date? I've tried counting my explicit uses of setNeedsDisplay and decrementing

Re: How to know if an NSView has pending draws

2016-02-04 Thread Clark S. Cox III
> On Feb 4, 2016, at 15:07, Jeff Evans wrote: > > Suppose one wants to do a task in an NSView only once it has no drawRect > calls pending. Is there any way to tell, for a particular NSView, if there > are any drawing events coming up? Whether, that is, the view is up to date? > > I've trie

Re: How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
Clark, it's a music app; a piece is composed and placed on the screen; there's a lot of massaging going on as the music adjusts visually. I want the play of the example to begin once there are no more updates remaining. That is no noticeable delay in terms of human time, but makes a difference i

Re: How to know if an NSView has pending draws

2016-02-04 Thread Clark S. Cox III
> On Feb 4, 2016, at 15:52, Jeff Evans wrote: > > Clark, it's a music app; a piece is composed and placed on the screen; > there's a lot of massaging going on as the music adjusts visually. Instead of looking to the view system to know when your code is done laying things out, why not ask you

Re: How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
Clark, you've got a great idea there. The notification method is perhaps not the one, because there are circumstances in which a draw method will conclude that further adjustment is going to be needed and will ask for other sections to adjust, etc. But the view that matters here is just a single

Re: How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
And bingo, that works perfectly. Looks like needsDisplay is exactly what I wanted. It's easy to check for the one view involved, but I hadn't noticed that property. So maybe it really was a dumb question. Thanks, Jeff On Feb 4, 2016, at 4:06 PM, Clark S. Cox III wrote: > On Feb 4, 2016, at

Re: How to know if an NSView has pending draws

2016-02-04 Thread Graham Cox
> On 5 Feb 2016, at 10:52 AM, Jeff Evans wrote: > > Clark, it's a music app; a piece is composed and placed on the screen; > there's a lot of massaging going on as the music adjusts visually. I want the > play of the example to begin once there are no more updates remaining. That > is no noti

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Alex Zavatone
On Feb 4, 2016, at 9:59 AM, Dave wrote: > XCode 7.2 (7C68). > Mac OS X (not iOS). > > Hi, > > I sent the following message to the XCode List, but now I’m wondering if > there is a bug in my code that is causing this weird behaviour? What could > cause then Debugger to think that a regular ob

Re: How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
Noah, yes, thanks, I think that is it. I spoke too soon in my that-works-perfectly announcement, but this must be the right track to follow. It's not clear to me when needsDisplay is being cleared in the view; I need to look into this a little more. So far, needsDisplay is sticking on, or appears

Re: How to know if an NSView has pending draws

2016-02-04 Thread Doug Hill
Jeff, I was wondering, are you attempting to sync the drawing with the music, or is this a performance issue you’re seeing? Doug Hill > On Feb 4, 2016, at 3:52 PM, Jeff Evans wrote: > > Clark, it's a music app; a piece is composed and placed on the screen; > there's a lot of massaging going

Re: How to know if an NSView has pending draws

2016-02-04 Thread dangerwillrobinsondanger
That's a bad idea. Use viewWillDraw for this approach Sent from my iPhone > On Feb 5, 2016, at 9:26 AM, Graham Cox wrote: > > >> On 5 Feb 2016, at 10:52 AM, Jeff Evans wrote: >> >> Clark, it's a music app; a piece is composed and placed on the screen; >> there's a lot of massaging going on

Re: How to know if an NSView has pending draws

2016-02-04 Thread Graham Cox
> On 5 Feb 2016, at 11:38 AM, dangerwillrobinsondan...@gmail.com wrote: > > That's a bad idea. Agreed :) > Use viewWillDraw for this approach Yes, that would be better. I think even better though would be to design the app so that the ‘need to know when the view is done’ is not a requirem

Re: How to know if an NSView has pending draws

2016-02-04 Thread Doug Hill
Jeff, AV sync issues are definitely tricky. I would be interested in hearing opinions from others on how they deal with these sync issues. I think you’re on the right track, in that you’re trying to use messages to determine when your visual state will match the audio state. As you’re seeing,

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Alex Zavatone
On Feb 4, 2016, at 11:12 AM, Dave wrote: > Jeez, really? I need a broken debugger like a hole in the dead at the moment. > Any idea what causes it and how to get rid of it? Using “po” won’t help as > it’s a custom object, I need to look at the properties. Any ideas how I can > do this? OK.

Re: How to know if an NSView has pending draws

2016-02-04 Thread Jeff Evans
Everyone, if it will be helpful I offer my solution: I just created a delayed task that would begin the play of the music a fraction of a second after requesting the draw of the newly loaded composition. This is pretty clean; the view does all it wants to do in much less time than I'm giving it,

Re: How to know if an NSView has pending draws

2016-02-04 Thread dangerwillrobinsondanger
You might want to look at SpriteKit. Sent from my iPhone > On Feb 5, 2016, at 11:06 AM, Jeff Evans wrote: > > Everyone, if it will be helpful I offer my solution: I just created a delayed > task that would begin the play of the music a fraction of a second after > requesting the draw of the