Re: auto layout exception: Unable to create description in descriptionForLayoutAttribute_layoutItem_coefficient. Something is nil

2014-11-07 Thread Chuck Soper
Thanks for your reply. I fixed the issue by removing all the constraints
and re-adding them. Each time I added some constraints, I confirmed
compatibility with iOS 7.1 The one thing that I did differently was that I
added width and height constraints to some images. I only had about a
dozen views (images, controls, etc.), so it didn't take very long.

I believe that the breaking constraint was generated by Xcode when I did a
"Add Missing Constraints" on a some selected images.


Chuck


On 11/6/14, 2:11 AM, "Jonathan Mitchell"  wrote:

>Frame 13 indicates that you have a breaking constraint.
>The framework bug (if such it be) is triggered on iOS 7.1 trying to log
>the breaking constraint.
>
>   12  Foundation  0x00010f2f420a NSLog + 148
>   13  UIKit   0x00010e86a097
>-[UIView(UIConstraintBasedLayout_EngineDelegate)
>engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:] + 62
>
>I would try and locate the breaking constraint and adjust my constrains
>accordingly.
>The constraint may be breaking in all iOS builds, check the logs for
>layout warnings.
>
>Obviously its is not desirable that the constraint issues crashes the app
>but if you can track it in the simulator I imagine that it is fixable.
>
>Jonathan
>
>
>> On 6 Nov 2014, at 01:41, Chuck Soper  wrote:
>> 
>> About a week ago, I turned on Auto Layout for xib file that contains a
>> view. I added constraints and my subviews (some images and a label) were
>> positioned exactly as I wanted. I thought that auto layout was great.
>> Today, I discovered that the app crashes on iOS 7.1 using the simulator
>> for an iPhone 5s. Console output is below. I'm using Xcode 6.1.
>>Everything
>> works fine on iOS 8.1. Xcode shows no warnings or errors for the
>> constraints. 
>> 
>> I found two similar questions on Stack Overflow, but they didn't help
>>me.
>> 
>>http://stackoverflow.com/questions/26024906/unable-to-create-description-
>>in
>> -descriptionforlayoutattribute-layoutitem-coeffi
>> 
>>http://stackoverflow.com/questions/14042016/ios-6-auto-layout-constraints
>>-e
>> rror-something-is-nil
>> 
>> Does anyone have thoughts how to solve this? If I can't find a
>>solution, I
>> may need to turn off auto layout and revert to using autoresizing.
>> 
>> Console output:
>> 2014-11-05 11:26:32.602 SSP[20856:60b] *** Terminating app due to
>>uncaught
>> exception 'NSInvalidArgumentException', reason: 'Unable to create
>> description in descriptionForLayoutAttribute_layoutItem_coefficient.
>> Something is nil'
>> *** First throw call stack:
>> (
>>  0   CoreFoundation  0x00011019c495
>> __exceptionPreprocess + 165
>>  1   libobjc.A.dylib 0x00010fa6599e
>> objc_exception_throw + 43
>>  2   CoreFoundation  0x00011019c2ad
>>+[NSException
>> raise:format:] + 205
>>  3   Foundation  0x00010f432548
>> descriptionForLayoutAttribute_layoutItem_coefficient + 145
>>  4   Foundation  0x00010f4323bc
>> -[NSLayoutConstraint equationDescription] + 216
>>  5   Foundation  0x00010f432831
>> -[NSLayoutConstraint description] + 297
>>  6   CoreFoundation  0x00011015d1b9 -[NSArray
>> descriptionWithLocale:indent:] + 345
>>  7   Foundation  0x00010f2c414e
>> _NSDescriptionWithLocaleFunc + 64
>>  8   CoreFoundation  0x000110121244
>> __CFStringAppendFormatCore + 7252
>>  9   CoreFoundation  0x00011015f913
>> _CFStringCreateWithFormatAndArgumentsAux + 115
>>  10  CoreFoundation  0x0001101bfa5b _CFLogvEx +
>>123
>>  11  Foundation  0x00010f2f4276 NSLogv + 79
>>  12  Foundation  0x00010f2f420a NSLog + 148
>>  13  UIKit   0x00010e86a097
>> -[UIView(UIConstraintBasedLayout_EngineDelegate)
>> engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:] + 62
>>  14  Foundation  0x00010f4292ac -[NSISEngine
>> 
>>handleUnsatisfiableRowWithHead:body:usingInfeasibilityHandlingBehavior:mu
>>tu
>> allyExclusiveConstraints:] + 521
>>  15  Foundation  0x00010f42a9b1 -[NSISEngine
>> 
>>tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasib
>>il
>> ityHandlingBehavior:mutuallyExclusiveConstraints:] + 353
>>  16  Foundation  0x00010f2e226b -[NSISEngine
>> 
>>tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuall
>>yE
>> xclusiveConstraints:] + 663
>>  17  Foundation  0x00010f433180
>> -[NSLayoutConstraint
>> 
>>_addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConst
>>an
>> tWasRounded:mutuallyExclusiveConstraints:] + 275
>>  1

How to obtain paths of laid-out text

2014-11-07 Thread Graham Cox
In the past, I've obtained bezier paths from laid out text using a subclass of 
NSLayoutManager that overrode the deprecated -showPackedGlyphs:length:... 
method. This method had a nice smooth impedance match with [NSBezierPath 
appendPackedGlyphs:]. The method has been deprecated since 10.7, but was still 
working fine in 10.9. In 10.10, this approach broke. The method is still 
called, but the resulting glyph runs include all sorts of extraneous characters 
which seem to be relics of earlier layouts (possibly NSLayoutManager does more 
aggressive caching in 10.10).

I'm wondering what the modern replacement for doing this is. There's a new 
method in NSLayoutManager, -showCGGlyphs:positions:count:... which seems to be 
the modern override point, but it no longer has a smooth match to the 
NSBezierPath methods that accept glyphs. For one thing, it supplies CGGlyph 
values, not NSGlyph values, and I can't determine from documentation whether 
these two are really the same thing, or whether a conversion is required (and 
if so how to do it). But trying to use the NSBezierPath method 
-appendGlyphs:count:inFont: by simply casting CGGlyph to NSGlyph doesn't 
produce the right outcome either - I'm still getting extraneous characters as 
well as some within the expected laid-out text that just seem random. The 
effect is worse than before.

What's the modern supported way to do this?

--Graham



___

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: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Greg Parker

> On Nov 7, 2014, at 12:35 PM, Jerry Krinock  wrote:
> 
>> On 2014 Nov 07, at 14:14, Greg Parker  wrote:
>> 
>> Which frame are you in when you try to read the register (the top frame, or 
>> some other frame)?
> 
> Some other.  #11 in this call stack:
> 
> #0   in strlen ()
> #1   in strdup ()
> #2   in objc_class::nameForLogging() ()
> #3   in cache_t::bad_cache(objc_object*, objc_selector*, objc_class*) ()
> #4   in objc_msgSend_corrupt_cache_error ()
> #5   in safeARCWeaklyStore ()
> #6   in -[NSMenuItem setTarget:] ()
> #7   in -[NSMenuItem copyWithZone:] ()
> #8   in -[NSSearchFieldCell(NSSearchFieldCell_Local) _updateSearchMenu] ()
> #9   in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
> #10  in _CFXNotificationPost ()
> #11  in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
> #12  in -[SSYSearchField appendToRecentSearches:] at SSYSearchField.m:53
> #13  in -[CntntViewController search:] at /CntntViewController.m:351
> #14  in -[BkmxDocWinCon search:] at BkmxDocWinCon.m:2907
> 
> I’d like to know what is the notification name, object and userInfo that 
> Cocoa is trying to post.

There's no way to get that information at that point. Those values are no 
longer in the machine's parameter registers. It is sometimes possible for the 
debugger to track down where those values are now, but at best it requires 
debug info for all frames from there to the top of the stack. You don't have 
debug info for CF or AppKit so there is no trail for the debugger to follow in 
this stack trace.

You may have better luck tracing it from the other side. Run to that line in 
appendToRecentSearches:, set a breakpoint on -[NSNotificationCenter 
postNotificationName:object:userInfo:], and step over your line. At those 
breakpoints you should be able to see the notification parameters in the 
parameter registers, assuming the notification is sent every time that line 
runs.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

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: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Jerry Krinock

> On 2014 Nov 07, at 14:14, Greg Parker  wrote:
> 
> Which frame are you in when you try to read the register (the top frame, or 
> some other frame)?

Some other.  #11 in this call stack:

#0   in strlen ()
#1   in strdup ()
#2   in objc_class::nameForLogging() ()
#3   in cache_t::bad_cache(objc_object*, objc_selector*, objc_class*) ()
#4   in objc_msgSend_corrupt_cache_error ()
#5   in safeARCWeaklyStore ()
#6   in -[NSMenuItem setTarget:] ()
#7   in -[NSMenuItem copyWithZone:] ()
#8   in -[NSSearchFieldCell(NSSearchFieldCell_Local) _updateSearchMenu] ()
#9   in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
#10  in _CFXNotificationPost ()
#11  in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#12  in -[SSYSearchField appendToRecentSearches:] at SSYSearchField.m:53
#13  in -[CntntViewController search:] at /CntntViewController.m:351
#14  in -[BkmxDocWinCon search:] at BkmxDocWinCon.m:2907

I’d like to know what is the notification name, object and userInfo that Cocoa 
is trying to post.

> What does `register read rdi` display in the top frame?

I just learned that this is a lldb command.  I’ve never used that command.  The 
next time this crash occurs, I’ll try it.  Maybe I can accelerate the next 
crash by scripting a stress test.

> objc_msgSend_corrupt_cache_error is trying to print some diagnostic info 
> before crashing. You should usually debug it as if it were a crash in 
> objc_msgSend itself: zombies, guard malloc, etc. The contents of the 
> diagnostics will occasionally offer clues that the object was valid but the 
> class was hit by a memory smasher.
> 
> In this case objc_msgSend_corrupt_cache_error is itself crashing while trying 
> to decode the data, which doesn't help distinguish "good object" from "bad 
> object”.

Thank you, Greg.  I have a few things to “push” on now :)


___

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: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Greg Parker

> On Nov 7, 2014, at 5:06 AM, Jerry Krinock  wrote:
> 
>> On 2014 Nov 04, at 01:33, Quincey Morris 
>>  wrote:
>> 
>> The fact that NSNotificationCenter is involved tells you that this is *not* 
>> KVO related.
> 
> OK, then that makes me even more upset that all I can get from po $rdi, po 
> $rdx, po $rcx, etc. when I need them nowadays is those damned “Couldn’t 
> materialize: couldn’t read the value of register” errors, even though my Edit 
> Scheme > Info says my configuration is Debug, whose optimization setting is 
> -O0, Deployment Postprocessing is NO and Strip Linked Product is NO.  Does 
> anyone know - is this new opacity the price we must pay for recent 
> optimizations in OS X?

Which frame are you in when you try to read the register (the top frame, or 
some other frame)? What does `register read rdi` display in the top frame?


>> Personally, I’d worry about entry #4. Surely 
>> ‘objc_msgSend_corrupt_cache_error’ has got to be very, very bad.
> 
> I hadn’t noticed that, but your remark makes sense.  Unfortunately, a Google 
> search of objc_msgSend_corrupt_cache_error returns 0 results.  If I remove 
> the underscores, I get one result indicating that, yes, this could be due to 
> a deallocced observer.

objc_msgSend_corrupt_cache_error is trying to print some diagnostic info before 
crashing. You should usually debug it as if it were a crash in objc_msgSend 
itself: zombies, guard malloc, etc. The contents of the diagnostics will 
occasionally offer clues that the object was valid but the class was hit by a 
memory smasher.

In this case objc_msgSend_corrupt_cache_error is itself crashing while trying 
to decode the data, which doesn't help distinguish "good object" from "bad 
object".


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

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: Saving a Document style app

2014-11-07 Thread Sean McBride
On Sat, 18 Oct 2014 11:06:35 -0500, Luther Baker said:

>I'd like to save my Document based app in the bundle style format. IE: I'd
>like to save things in a directory - like apps like OmniOutliner do.
>
>Out of the box, I get the option to save as sqlite, binary or XML. What I'd
>like is to save a 'bundle' with my own extension and nest things like the
>the sqlite database inside of it.
>
>Is this type of functionality provided for me by another Cocoa framework or
>is this a strictly manual process that has been passed down as convention
>from dev to dev?
>
>Is anyone aware of an Apple example app that would demonstrate this? Or any
>suggestions regarding an Open Source Cocoa App by anyone here that would be
>worth browsing through for this type of stuff?

Indeed Apple recommends using a package for documents, but as you've found, it 
can't easily be done with NS(Persistent)Document.  Please do file a radar for 
this, as the current situation is ridiculous really.

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada



___

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: Weak linking

2014-11-07 Thread Greg Parker

> On Nov 7, 2014, at 3:54 AM, Satyanarayana Chebrolu 
>  wrote:
> 
> Hi folks,
> We have an application, which is supporting from 10.5(Leopard) to 
> 10.10(Yosemite). Inside the application, there is  a  custom 
> framework(X.framework), which has some custom code for Appkit classes.
> Off late, decided to introduce a new feature, which will be supported from 
> 10.7 to 10.10. And then subclassed the classes (NSTableRowView, 
> NSTableCellView), which are part of the X.framework.
> 
> Problem:
> The app is getting crashed when we launch it on 10.5 and 10.6 machines saying 
> that “dyld: Symbol not found: _OBJC_CLASS_$_NSTableCellView”.
> 
> Understand that NSTableRowView, NSTableCellView are not existing on 10.5 and 
> 10.6, so the subclasses should be weakly linked.

Weak import of Objective-C symbols does not work on 10.5 and 10.6. The runtime 
support for it was introduced in 10.6.8.

One solution is to drop support for OS versions older than 10.6.8.

Another solution is to use dynamic framework loading to keep the code that uses 
NSTableCellView out of your process when the OS is too old. You would perform 
an OS version check and use NSBundle or dlopen to load your framework if the OS 
version is new enough. This works for anything.

Another solution is to use NSClassFromString(@"NSTableCellView") and never 
access the class directly. This works for classes that you use but do not 
subclass; it does not work if you need to subclass a class.

It is possible to create a subclass dynamically at runtime, after performing an 
OS version check. This is typically feasible only in simple cases.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

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: Weak linking

2014-11-07 Thread Satyanarayana Chebrolu
Yes, its 10.5 only.

On 11/7/14, 9:46 PM, "Fritz Anderson"  wrote:

>
>On Nov 7, 2014, at 5:54 AM, Satyanarayana Chebrolu
> wrote (slightly more appropriate to
>xcode-users):
>>
>> The app is getting crashed when we launch it on 10.5 and 10.6 machines
>>saying that ³dyld: Symbol not found: _OBJC_CLASS_$_NSTableCellView².
>>
>> Understand that NSTableRowView, NSTableCellView are not existing on
>>10.5 and 10.6, so the subclasses should be weakly linked.
>>
>> Tried, by making Cocoa & X.frameworks as Weak linking(Optional) under
>>Link Binary With Libraries section of the application target, but still
>>the same issue. It seems, I am missing something.
>
>Have you set the ³Deployment Target² (most easily found under the General
>tab in the Target editor) to 10.5?
>
>   ‹ F
>
>

This email and any attachments are confidential, and may be legally privileged 
and protected by copyright. If you are not the intended recipient dissemination 
or copying of this email is prohibited. If you have received this in error, 
please notify the sender by replying by email and then delete the email 
completely from your system. Any views or opinions are solely those of the 
sender. This communication is not intended to form a binding contract unless 
expressly indicated to the contrary and properly authorised. Any actions taken 
on the basis of this email are at the recipient's own risk.

___

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: Weak linking

2014-11-07 Thread Fritz Anderson

On Nov 7, 2014, at 5:54 AM, Satyanarayana Chebrolu 
 wrote (slightly more appropriate to 
xcode-users):
> 
> The app is getting crashed when we launch it on 10.5 and 10.6 machines saying 
> that “dyld: Symbol not found: _OBJC_CLASS_$_NSTableCellView”.
> 
> Understand that NSTableRowView, NSTableCellView are not existing on 10.5 and 
> 10.6, so the subclasses should be weakly linked.
> 
> Tried, by making Cocoa & X.frameworks as Weak linking(Optional) under Link 
> Binary With Libraries section of the application target, but still the same 
> issue. It seems, I am missing something.

Have you set the “Deployment Target” (most easily found under the General tab 
in the Target editor) to 10.5?

— F



___

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: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Kyle Sluder
On Fri, Nov 7, 2014, at 09:34 AM, David Wood wrote:
> 
> > On Nov 7, 2014, at 9:36 AM, Charles Jenkins  wrote:
> > 
> > Well, if you have only one argument, then arguments.count would be 1, but 
> > to get the argument, you’d ask for Process.arguments[0]. Arrays are 
> > zero-based.  
> 
> D'oh. Well, that fixed it. The final result looks like this:
> 
> var inputValue = (Process.arguments.count > 1) ?
> Process.arguments[1].toInt()! : defaultValue
> 
> ...and it runs properly in both in Xcode and as a command-line tool.
> 
> Only now does it occur to me that the place to post this would have been
> a Swift-dev mailing list. Is that even a thing? There doesn't seem to be
> one of those on lists.apple.com.

There's no mailing list, but there's a very active section of the Dev
Forums, including far more Apple participation than on this list:


--Kyle Sluder

___

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: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Scott Ribe
On Nov 7, 2014, at 8:34 AM, David Wood  wrote:
> 
> Only now does it occur to me that the place to post this would have been a 
> Swift-dev mailing list. Is that even a thing?

No, use of Swift is so intimately tied to Cocoa that they're having those 
discussions here.

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





___

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: Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood

> On Nov 7, 2014, at 9:36 AM, Charles Jenkins  wrote:
> 
> Well, if you have only one argument, then arguments.count would be 1, but to 
> get the argument, you’d ask for Process.arguments[0]. Arrays are zero-based.  

D'oh. Well, that fixed it. The final result looks like this:

var inputValue = (Process.arguments.count > 1) ? Process.arguments[1].toInt()! 
: defaultValue

...and it runs properly in both in Xcode and as a command-line tool.

Only now does it occur to me that the place to post this would have been a 
Swift-dev mailing list. Is that even a thing? There doesn't seem to be one of 
those on lists.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

UITableView - distinguish selection from drill-down

2014-11-07 Thread Martin Hewitson
Dear list,

I’m trying to find a good idiom for allowing the user to select an item from a 
hierarchical tree of items. The items are categories, and categories can 
contain sub-categories, etc. This is easy to present using a UITableView and 
segues. But in this particular part of the UI, I want to allow the user to 
select a particular category (in order to move a category to another place in 
the tree). So, what’s a good way to distinguish between the user touching a 
cell because they want to select that cell, or because they want to drill down 
to sub-categories? Clearly the presence of a disclosure indicator gives the 
user the impression that touching a cell will drill-down. And this is good. But 
how can the user signal that they rather want to select the category (let’s 
call that a ‘pick’ action) instead of drilling down?  What I’d like is that 
touching the centre of the cell selects it, and touching the right side 
drills-down. Is such a thing possible/supported?

I tried googling around a bit but I failed to find a good search string; always 
ended up with basic drill-down tutorials.

Looking for good ideas….

Many thanks,

Martin



___

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

Serious bug for UICollectionView

2014-11-07 Thread Colas B
Dear cocoa-dev,

I am facing the following bug with `UICollectionView` in the **horizontal 
scrolling mode** (`iOS 8`, `iOS 7`, the only ones I have tested).

I would like to have your views on this bug and on how I could elegantly fix it 
(and possibly fix it so that when Apple fixes it, my fix won't bring unattended 
effects). The message is also for reporting the bug to the community. I have 
already sent a report to Apple.

I set up the collection view manually, and choose a flow layout with an 
horizontal scrolling.

UICollectionViewFlowLayout * layout = [[UICollectionViewFlowLayout alloc] 
init] ;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal ;
layout.minimumInteritemSpacing = 5 ;
layout.minimumLineSpacing = 100 ;

The bug happens when the cells in the UICollectionView does not have the same 
sizes.


--> when all the cells have the same size, 
  • minimumInteritemSpacing is for the vertical space between cells
  • minimumLineSpacing is for the horizontal space

--> BUT as soon as one of the cells have a different size, the roles are 
interchanged:
  • minimumInteritemSpacing is for the horizontal space between cells 
  • minimumLineSpacing is for the vertical space.

## Link to a minimal non-working example

https://github.com/colasjojo/TEST_COLLECTION_VIEW_BUG
___

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: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Charles Jenkins
Well, if you have only one argument, then arguments.count would be 1, but to 
get the argument, you’d ask for Process.arguments[0]. Arrays are zero-based.  

—  

Charles Jenkins


On Friday, November 7, 2014 at 09:30, David Wood wrote:

> (Dagnabbed mailing list didn’t set the ReplyTo field! What’s up with that?)
>  
> > On Nov 7, 2014, at 8:57 AM, Charles Jenkins  > (mailto:cejw...@gmail.com)> wrote:
> >  
> > It looks to me like Process.arguments[] does not return an optional value. 
> > I think you need to find out how many elements are in the array before 
> > attempting to access them by an index.
> >  
> > —  
> >  
> > Charles Jenkins
>  
> Sadly, that’s what I gather too. So it looks like there’s no way to work an 
> array subscript into an optional chain, for safeguarding purposes.
>  
> Strangely, this new construction also fails, and for the same reason too:
>  
> var inputValue = (Process.arguments.count > 0) ? 
> Process.arguments[1].toInt()! : defaultValue
>  
> “fatal error: Array index out of range”
>  
> I’m running it now from inside XCode, so there are no arguments; would that 
> be a problem?
> ___
>  
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> (mailto: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 
> (http://lists.apple.com)
>  
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cejwork%40gmail.com
>  
> This email sent to cejw...@gmail.com (mailto:cejw...@gmail.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: Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood
(Dagnabbed mailing list didn’t set the ReplyTo field! What’s up with that?)

> On Nov 7, 2014, at 8:57 AM, Charles Jenkins  wrote:
> 
> It looks to me like Process.arguments[] does not return an optional value. I 
> think you need to find out how many elements are in the array before 
> attempting to access them by an index.
> 
> — 
> 
> Charles Jenkins

Sadly, that’s what I gather too. So it looks like there’s no way to work an 
array subscript into an optional chain, for safeguarding purposes.

Strangely, this new construction also fails, and for the same reason too:

var inputValue = (Process.arguments.count > 0) ? Process.arguments[1].toInt()! 
: defaultValue

“fatal error: Array index out of range”

I’m running it now from inside XCode, so there are no arguments; would that be 
a problem?
___

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

Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood
I'm just trying to cut my teeth on Swift here, and there are a few command-line 
activities I like to use to make sure I understand what a language is doing.

The goal in this case is to take a parameter from the command line, that may or 
may not have been entered with the command that started the program, and assign 
it to a variable for use.

The "Nil Coalescing" operator (??) like the perfect construction:

var inputValue = Process.arguments[1].toInt() ?? defaultValue

And the preprocessor thought it looked good too.

But at runtime, Xcode reports a "Fatal error: Array index out of range."

Is this a bug in the preprocessor (for not flagging something that may not 
exist), the language itself (for failing to branch upon finding a non-existent 
value) or my understanding of the capabilities of the language (for trying to 
get it to do too much)?
___

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: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Jerry Krinock

> On 2014 Nov 04, at 01:33, Quincey Morris 
>  wrote:
> 
> The fact that NSNotificationCenter is involved tells you that this is *not* 
> KVO related.

OK, then that makes me even more upset that all I can get from po $rdi, po 
$rdx, po $rcx, etc. when I need them nowadays is those damned “Couldn’t 
materialize: couldn’t read the value of register” errors, even though my Edit 
Scheme > Info says my configuration is Debug, whose optimization setting is 
-O0, Deployment Postprocessing is NO and Strip Linked Product is NO.  Does 
anyone know - is this new opacity the price we must pay for recent 
optimizations in OS X?

> Personally, I’d worry about entry #4. Surely 
> ‘objc_msgSend_corrupt_cache_error’ has got to be very, very bad.

I hadn’t noticed that, but your remark makes sense.  Unfortunately, a Google 
search of objc_msgSend_corrupt_cache_error returns 0 results.  If I remove the 
underscores, I get one result indicating that, yes, this could be due to a 
deallocced observer.

I appreciate your thoughts on thread safety too, but I can’t find any related 
multithreading.

I may need to just live with this rare crash until po $rdi, po $rdx, po $rcx, 
etc. have a good day and decide they can give me a clue.


___

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

Weak linking

2014-11-07 Thread Satyanarayana Chebrolu
Hi folks,
We have an application, which is supporting from 10.5(Leopard) to 
10.10(Yosemite). Inside the application, there is  a  custom 
framework(X.framework), which has some custom code for Appkit classes.
Off late, decided to introduce a new feature, which will be supported from 10.7 
to 10.10. And then subclassed the classes (NSTableRowView, NSTableCellView), 
which are part of the X.framework.

Problem:
The app is getting crashed when we launch it on 10.5 and 10.6 machines saying 
that “dyld: Symbol not found: _OBJC_CLASS_$_NSTableCellView”.

Understand that NSTableRowView, NSTableCellView are not existing on 10.5 and 
10.6, so the subclasses should be weakly linked.

Tried, by making Cocoa & X.frameworks as Weak linking(Optional) under Link 
Binary With Libraries section of the application target, but still the same 
issue. It seems, I am missing something.

Should be a straight way to fix it. Will be great if you can share your 
thoughts.

I am using Xcode 6.1.

Thanks in advance.

-Satya
This email and any attachments are confidential, and may be legally privileged 
and protected by copyright. If you are not the intended recipient dissemination 
or copying of this email is prohibited. If you have received this in error, 
please notify the sender by replying by email and then delete the email 
completely from your system. Any views or opinions are solely those of the 
sender. This communication is not intended to form a binding contract unless 
expressly indicated to the contrary and properly authorised. Any actions taken 
on the basis of this email are at the recipient's own risk.
___

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: Editing NSOutlineView Group Item

2014-11-07 Thread Luther Baker
http://openradar.appspot.com/18906942




On Wed, Nov 5, 2014 at 7:23 AM, Luther Baker  wrote:

> Thanks and thanks. I'll follow up on both your suggestions.
>
> Again, many thanks for your time Quincey!
>
> Luther
>
>
> On Nov 5, 2014, at 2:03 AM, Quincey Morris <
> quinceymor...@rivergatesoftware.com> wrote:
>
> On Nov 4, 2014, at 14:39 , Luther Baker  wrote:
>
>
> I've created a project on github that essentially duplicates the problem
> I'm having.
>
> $ git clone
> https://github.com/EffectiveProgramming/LBOutlineViewDemo.git
>
>
> I don’t see anything in it that should prevent the reload from working, so
> I don’t know what else to suggest except submit this project as a bug
> report.
>
> OTOH, based on the direction that you seem to be heading, I’d suggest you
> might do better to use bindings (from your table cell view subviews to the
> table cell view’s objectValue property, which would be set to the custom
> list item) and KVC to get the outline view to update, rather than using
> reload. That approach doesn’t answer the issue you’ve run into, but it
> might make it moot.
>
>
___

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