Xcode Debugger Shows Incorrect Variable Information

2015-08-07 Thread Richard Charles
I have a heavily customized managed object with some attributes using ivar 
backing. I recently added an ivar of type NSObject and experienced some 
difficulty with the debugger. The simplified code is shown below.

@implementation MyManagedObject
{
 MyStruct _ivar1;
 MyStruct _ivar2; // debugger shows this is global variable
 MyStruct _ivar3;
 double _ivar4;

 NSObject *_ivar5; // recently added
}

- (void)awakeFromFetch
{
 [super awakeFromFetch];
 _ivar5 = [[NSObject alloc] init];

} // break point

@end

When a break point is placed at the closing brace of awakeFromFetch, the 
debugger shows that _ivar2 and only _ivar2 is a global variable (this is not 
correct).

If _ivar5 is removed from the code, then when a break point is placed at the 
closing brace of awakeFromFetch, the debugger shows no global variables 
whatsoever (this is correct).

http://stackoverflow.com/questions/9917646/what-do-the-icons-in-xcode-4s-debug-area-variable-list-mean

Any ideas?

--Richard Charles


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Auto-layout annoyance

2015-08-07 Thread Charles Srstka
On Aug 7, 2015, at 4:48 PM, SevenBits  wrote:
> 
> I’m experience a slight bug? in my app relating to auto layout constraints. I 
> have a preference pane which should be expanding to fill the length of one 
> center-aligned element. This does not happen. What happens is the xib is 
> designed for English (my Base language), and in German, one particular text 
> checkbox is expanding outside of the bounds of the container, making it 
> impossible for the user to read the entire label or click the checkbox.
> 
> I have these constraints assigned to the element:
> 
> - Align Center X to Superview
> - Top Space to Superview Equals Default
> - Bottom Space to (a button) Equals 14
> 
> Xcode’s preview window shows the current behavior, so I assume this can be 
> expected. What I want is the element to be center aligned if its width is 
> less than that of the parent view, but if it is larger, then I want the 
> parent view to expand so that the entire checkbox and its label can fit 
> within the parent view.
> 
> I tried setting a constraint to set the Trailing Space to the Superview, and 
> this displays properly in the Preview pane, but *not* in the app itself.
> 
> I hope that this is clear. Can anyone provide any pointers?

Assuming I’m reading and understanding what you want to do properly, I’d try 
this:

- Trailing space to Superview >= default
- Leading space to Superview >= default
- Compression resistance priority set to something high

See if that does what you want.

Charles
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Auto-layout annoyance

2015-08-07 Thread SevenBits
Hi all,

I’m experience a slight bug? in my app relating to auto layout constraints. I 
have a preference pane which should be expanding to fill the length of one 
center-aligned element. This does not happen. What happens is the xib is 
designed for English (my Base language), and in German, one particular text 
checkbox is expanding outside of the bounds of the container, making it 
impossible for the user to read the entire label or click the checkbox.

I have these constraints assigned to the element:

- Align Center X to Superview
- Top Space to Superview Equals Default
- Bottom Space to (a button) Equals 14

Xcode’s preview window shows the current behavior, so I assume this can be 
expected. What I want is the element to be center aligned if its width is less 
than that of the parent view, but if it is larger, then I want the parent view 
to expand so that the entire checkbox and its label can fit within the parent 
view.

I tried setting a constraint to set the Trailing Space to the Superview, and 
this displays properly in the Preview pane, but *not* in the app itself.

I hope that this is clear. Can anyone provide any pointers?

Thanks.


signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass

2015-08-07 Thread Fritz Anderson
Speculation: This may be like the -window property of NSWindowController. 
Accessing it is the recommended way to force the controller to instantiate the 
window, even if you don’t care about the result.

In this case, _you_ may not care what super’s NSSplitViewDelegate methods do, 
but NSSplitViewController needs to hear about the events they represent.

— F

On 7 Aug 2015, at 2:33 PM, Bill Cheeseman  wrote:

> I've always been comfortable calling super when it doesn't return a result, 
> or when I am expected to use super's result for some purpose in my override. 
> But it feels very bizarre to be calling a super implementation and doing 
> nothing with whatever result it returns.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode 6.4 on the Developer download site.

2015-08-07 Thread Gary L. Wade
Be sure you have Developer Tools selected as a filter. For some reason, 
versions after than 6.1.1 were not tagged for iOS or OS X.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Aug 7, 2015, at 1:27 PM, Alex Zavatone  wrote:
> 
> Yeah, no idea.  I downloaded i fine on another Mac.
> 
> 
>> On Aug 7, 2015, at 4:00 PM, Jonathan Mitchell wrote:
>> 
>> 
>>> On 7 Aug 2015, at 20:45, Alex Zavatone  wrote:
>>> 
>>> We were told a few times that the latest Xcodes should always be on the 
>>> developer downloads site at:
>>> 
>>> https://developer.apple.com/downloads/
>>> 
>>> I'm trying to download a copy of Xcode 6.4's installer and I can't see 
>>> anything up on that site that's more recent than 6.1.1 using Safari and 
>>> searching for Xcode
>>> 
>>> Any ideas here?
>> hmm...
>> I can see it fine and can download from 
>> http://adcdownload.apple.com/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg.
>> Not sure what gremlins you have encountered.
>> 
>> Jonathan

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass

2015-08-07 Thread Quincey Morris
On Aug 7, 2015, at 12:33 , Bill Cheeseman  wrote:
> 
> But by calling super the way I showed in my original post, I am not making 
> use of any result that might be returned by super's implementation of the 
> method. And how could super's implementation return anything meaningful to my 
> application anyway?

I agree it’s unclear, as it always is when overriding but calling super.

The real question is, who’s in control of the value that the delegate method 
returns? I think you used ‘canCollapse…’ as an example, so how is it really 
determined whether collapsing is allowed? If the superclass is deciding, you 
should return its value.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode 6.4 on the Developer download site.

2015-08-07 Thread Alex Zavatone
Yeah, no idea.  I downloaded i fine on another Mac.


On Aug 7, 2015, at 4:00 PM, Jonathan Mitchell wrote:

> 
>> On 7 Aug 2015, at 20:45, Alex Zavatone  wrote:
>> 
>> We were told a few times that the latest Xcodes should always be on the 
>> developer downloads site at:
>> 
>> https://developer.apple.com/downloads/
>> 
>> I'm trying to download a copy of Xcode 6.4's installer and I can't see 
>> anything up on that site that's more recent than 6.1.1 using Safari and 
>> searching for Xcode
>> 
>> Any ideas here?
> hmm...
> I can see it fine and can download from 
> http://adcdownload.apple.com/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg.
> Not sure what gremlins you have encountered.
> 
> Jonathan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode 6.4 on the Developer download site.

2015-08-07 Thread Jonathan Mitchell

> On 7 Aug 2015, at 20:45, Alex Zavatone  wrote:
> 
> We were told a few times that the latest Xcodes should always be on the 
> developer downloads site at:
> 
> https://developer.apple.com/downloads/
> 
> I'm trying to download a copy of Xcode 6.4's installer and I can't see 
> anything up on that site that's more recent than 6.1.1 using Safari and 
> searching for Xcode
> 
> Any ideas here?
hmm...
I can see it fine and can download from 
http://adcdownload.apple.com/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg.
Not sure what gremlins you have encountered.

Jonathan













___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode 6.4 on the Developer download site.

2015-08-07 Thread Jonathan Mitchell

> On 7 Aug 2015, at 20:45, Alex Zavatone  wrote:
> 
> We were told a few times that the latest Xcodes should always be on the 
> developer downloads site at:
> 
> https://developer.apple.com/downloads/
> 
> I'm trying to download a copy of Xcode 6.4's installer and I can't see 
> anything up on that site that's more recent than 6.1.1 using Safari and 
> searching for Xcode
> 
> Any ideas here?
hmm...
I can see it fine and can download from 
http://adcdownload.apple.com/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg.
Not sure what gremlins you have encountered.

Jonathan













___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass

2015-08-07 Thread Bill Cheeseman
Thanks, that helps me to understand it a little better. But by calling super 
the way I showed in my original post, I am not making use of any result that 
might be returned by super's implementation of the method. And how could 
super's implementation return anything meaningful to my application anyway? My 
override is the only one that knows how to return a result that is meaningful 
to my application. I've always been comfortable calling super when it doesn't 
return a result, or when I am expected to use super's result for some purpose 
in my override. But it feels very bizarre to be calling a super implementation 
and doing nothing with whatever result it returns.

I guess what you're saying is that super takes advantage of my call to fiddle 
around with some stuff internally, and then it's happy to stand back and let me 
do what I will with my override.

But just for the heck of it I implemented several of these delegate methods 
without calling super, and they worked just fine. Very confusing.

-- 

Bill Cheeseman - wjcheese...@comcast.net

> On Aug 7, 2015, at 1:09 PM, Quincey Morris 
>  wrote:
> 
> On Aug 7, 2015, at 05:47 , Bill Cheeseman  > wrote:
>> 
>> I don't understand why the fact that NSSplitViewController "implements" 
>> these delegate methods requires my override to call super, or what calling 
>> super accomplishes in this situation.
> 
> According to the latest header files, setting a different delegate on the 
> controller’s splitView causes an exception. That means there really is no 
> delegation pattern here (from your point of view). Instead, there are just 
> some delegate-like methods you can override (but must call super if you do, 
> in the ordinary way).
> 
> Internally, of course, there is delegation going one, but it’s now an 
> implementation detail.
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass

2015-08-07 Thread Quincey Morris
On Aug 7, 2015, at 05:47 , Bill Cheeseman  wrote:
> 
> I don't understand why the fact that NSSplitViewController "implements" these 
> delegate methods requires my override to call super, or what calling super 
> accomplishes in this situation.

According to the latest header files, setting a different delegate on the 
controller’s splitView causes an exception. That means there really is no 
delegation pattern here (from your point of view). Instead, there are just some 
delegate-like methods you can override (but must call super if you do, in the 
ordinary way).

Internally, of course, there is delegation going one, but it’s now an 
implementation detail.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Occasional NSInternalInconsistencyException - could not load nib

2015-08-07 Thread Jonathan Mitchell
Hi Sean
> On 7 Aug 2015, at 15:30, Sean McBride  wrote:
> 
> On Fri, 7 Aug 2015 15:04:19 +0100, Jonathan Mitchell said:
> 
>> Occasionally I get crash reports like so:
>> 
>> Terminating app due to uncaught exception
>> 'NSInternalInconsistencyException', reason: '-[TSStackMenuItem loadView]
>> could not load the "TSStackMenuItem_Image_Info" nib.’
> 
> Jonathan,
> 
> It rings a bell.  Try moving/renaming your app while it's running.  The guts 
> of Cocoa may have a stale cache and/or load things by full path.
> 
Thanks for that - I hadn’t considered that bit of user sabotage in this case.
Unfortunately it doesn’t seem to trigger this issue - though it does more or 
less render the app inoperable, even it doesn’t crash.

Jonathan


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Occasional NSInternalInconsistencyException - could not load nib

2015-08-07 Thread Jonathan Mitchell
Occasionally I get crash reports like so:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: '-[TSStackMenuItem loadView] could not load the 
"TSStackMenuItem_Image_Info" nib.’

They are very infrequent and don’t occur in testing.
I doubt that the nibs are actually missing from the bundle as the problem 
report rate would be much higher.

I now have two reported instances of this in two separate NSViewController 
subclasses.

Looking at these the only oddity that they seem to have in common is that I 
have inadvertently included calls to -view (which causes nib loading) during 
-initWithNibName:bundle:.
This is something I generally take pains to avoid.

Has anyone else encountered something similar?
The infrequency of the execution makes it hard to confirm my suggested fix 
(which is to not call -view during -init). 

Thanks

Jonathan












___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

How to implement NSSplitViewDelegate methods in an NSSplitViewController subclass

2015-08-07 Thread Bill Cheeseman
The header file comments in NSSplitViewController (introduced in OS X 10.10 
Yosemite) state with respect to certain NSSplitViewDelegate methods that are 
"implemented" in NSSplitViewController that they "require a call to super if 
overriden [sic] by a subclass." How do I call super in an override of these 
delegate methods?

All I can think of is this, from my subclass of NSSplitViewController (written 
in Swift 2):

override func splitView(splitView: NSSplitView, canCollapseSubview subview: 
NSView) -> Bool {
 super.splitView(splitView, canCollapseSubview: subview) // must call super
 return subview == splitView.subviews[1]
}

But I don't understand why the fact that NSSplitViewController "implements" 
these delegate methods requires my override to call super, or what calling 
super accomplishes in this situation. As a result, I don't feel comfortable 
that this is the right way to do it. I wonder if this has something to do with 
the other problem I posted about a few minutes ago, namely, that 
double-clicking the divider does collapse the subview when I implement this and 
the related delegate methods, but it does not set the 'collapsed' property of 
NSSplitViewItem to true.

-- 

Bill Cheeseman - wjcheese...@comcast.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Problem with 'collapsed' property in NSSplitViewItem

2015-08-07 Thread Bill Cheeseman
I am having difficulty setting up NSSplitViewController and NSSplitViewItem, 
introduced in OS X 10.10 Yosemite.

Specifically, the 'collapsed' property of NSSplitViewItem does not return true 
after the bottom split view item of my horizontal split view collapses. I have 
set the 'canCollapse' property to true, and as a result double-clicking the 
divider does collapse the bottom split view item. I implemented the 
NSSplitViewDelegate -splitViewDidResizeSubviews: delegate method to test the 
'collapsed' property of the bottom split view item and the 'hidden' property of 
its view -- 'hidden' returns true but 'collapsed' returns false.

All this happens whether or not I override the NSSplitViewDelegate delegate 
methods that are implemented in NSSplitViewController, such as 
-splitView:shouldCollapseSubView:forDoubleClickOnDividerAtIndex:. Implementing 
the delegate method appears to be nothing more than an alternative to setting 
the 'canCollapse' property. Is this right?

I also installed a "Collapse" button whose action method toggles the 
'collapsed' property. This works perfectly.

Can anybody confirm this is a bug in NSSplitViewItem, or suggest what I might 
have misunderstood about the proper use of these classes?

-- 

Bill Cheeseman - wjcheese...@comcast.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UICollectionView not obeying zIndex of UICollectionViewLayoutAttributes

2015-08-07 Thread Ted Bradley
Thanks for the reply. I made a standalone project in order to strip out all my 
extraneous code. In the process I think I found my own solution.

override func initialLayoutAttributesForAppearingItemAtIndexPath(itemIndexPath: 
NSIndexPath) -> UICollectionViewLayoutAttributes?
override func 
finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) 
-> UICollectionViewLayoutAttributes?

were not also applying the new zIndex so I think this was what was causing it.

Just thought I should post back the solution in case this comes up in a search 
for anyone else.


Thanks again,

Ted

> On 6 Aug 2015, at 16:42, Luke Hiesterman  wrote:
> 
> Can you post your implementations -layoutAttributesForElementsInRect: as well 
> as -layoutAttributesForItemAtIndexPath:?
> 
> Luke
> 
>> On Aug 6, 2015, at 8:09 AM, Ted Bradley  wrote:
>> 
>> The effect I'm trying to achieve is a kind of sticky header cell. It's 
>> important to me that the sticky cell floats over the top of the others. 
>> Something a bit like this:
>> 
>>  ┌──┐ 
>>  │  │ 
>>  │  Cell 0  │ 
>>  │  ├┐
>>  └┬─┘│
>>   │  Cell 4  │
>>   │  │
>>   └──┘
>>   ┌──┐
>>   │  │
>>   │  Cell 5  │
>>   │  │
>>   └──┘
>>   ┌──┐
>>   │  │
>>   │  Cell 6  │
>>   │  │
>>   └──┘
>> Cell 4, 5 and 6 would normally viewable and I'm constructing the attributes 
>> for cell 0 in my UICollectionViewFlowLayout subclass during 
>> layoutAttributesForElementsInRect:. All I do is call the super 
>> implementation, determine which cell I need to add in and then construct the 
>> UICollectionViewLayoutAttributes(forCellWithIndexPath:). I then set the 
>> zIndex for it to 1 (default is `0`).
>> 
>> The problem I'm getting is that the UICollectionView seems to always ignore 
>> the `zIndex`
>> 
>>  ┌──┐ 
>>  │  │ 
>>  │  Cell 0  │ 
>>  │┌─┴┐
>>  └┤  │
>>   │  Cell 4  │
>>   │  │
>>   └──┘
>>   ┌──┐
>>   │  │
>>   │  Cell 5  │
>>   │  │
>>   └──┘
>>   ┌──┐
>>   │  │
>>   │  Cell 6  │
>>   │  │
>>   └──┘
>> 
>> Now I believe it's possible to visually sort this out using a 3d transform, 
>> but that doesn't work for me as I don't want any taps going to the cell 
>> which is over the top. So in this example I don't want Cell 4 receiving taps 
>> intended for Cell 0.
>> 
>> Does anyone have any ideas? This is on iOS 8.4.
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to luket...@apple.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com