Sorting a view based TableView with bindings

2013-05-02 Thread Gerriet M. Denkmann
I have a cell-based TableView which is filled via ArrayController using 
bindings.
Sorting just works.

Now I changed this to a view-based TableView and suddenly no more automatic 
sorting.
It has just one column which uses an NSTableCellView. 
The Static Text has it's Value bound to Table Cell View objectValue.Name.

And I want the column to be sorted via localizedCaseInsensitiveCompare:.

I tried to set in “Table Column Attributes inspector”:
Sort Key = objectValue.Name or Name
Selector = localizedCaseInsensitiveCompare (with trailing : or not)
The values seems to be irrelevant; anything non-nil activates the up/down 
triangle. But nothing changes the order of the rows.

When I click on the header nothing happens (except the current selection is set 
to none and the small triangle on the right side alternate between up and down).

What am I missing? What documentation should I read?

Gerriet.


___

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: Sorting a view based TableView with bindings

2013-05-02 Thread Quincey Morris
On May 2, 2013, at 00:31 , "Gerriet M. Denkmann"  wrote:

> When I click on the header nothing happens (except the current selection is 
> set to none and the small triangle on the right side alternate between up and 
> down).

At a wild guess, I'd suspect you neglected to bind the table's Sort Descriptors 
binding to the array controller's "sortDescriptors" property. This probably 
happens automatically for a cell-based table view, but perhaps (like the 
Content binding) needs to be done explicitly for a view-based table view.

> What am I missing?

Possibly that using bindings with a view-based table view is more trouble than 
it's worth? (I don't mean bindings to the cell view's objectValue. That's worth 
doing.) But I digress…

___

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

Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hello. 

I have two NSObject subclasses -  say MyA and MyB.

- Each MyA instance. creates and owns a MyB instance. 
- MyB instances create an NSThread, and live their asynchronous life, 
communicating with a remote internet server, and  sometimes with their owner 
(the MyA object) who lives in the main thread.

- It can happen that MyA wants to dispose of its MyB, (in the main thread), and 
replace it with another instance of MyB.
- However, MyB cannot be released instantaneously, or synchronously, because 
its thread should gracefully close and disconnect from the server, which takes 
long seconds and even more.

Currently, MyB retains itself within its thread, and releases itself just 
before the thread exits. I know it is bad practice (self retaining objects), 
but I did not yet think of a better way. 

This way, when the owner releases its MyB and replaces its reference with a new 
MyB object, the MyB is just released once, and does not get deallocated. When 
its thread finishes its cycle in the background, the thread function releases 
the objects again, and returns.

This seems to be OK --- but in rare cases the program crashes trying to REENTER 
the "dealloc" of MyB It seems that the actual "release" method gets called 
both from the thread context and the main thread's context.

What's the best way to get out of this? How can I simply synchronize the 
"release" calls, without blocking both threads? Maybe I should restrict myself 
to retaining/releasing in the main thread only? Is there some syntactic Obj-C 
sugar to ease such things?

Thanks!


Motti Shneor, Mac OS X Software Architect & Team Leader
Spectrum Reflections Ltd.
+972-54-3136621




___

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: Sorting a view based TableView with bindings

2013-05-02 Thread Gerriet M. Denkmann

On 2 May 2013, at 14:49, Quincey Morris  
wrote:

> On May 2, 2013, at 00:31 , "Gerriet M. Denkmann"  wrote:
> 
>> When I click on the header nothing happens (except the current selection is 
>> set to none and the small triangle on the right side alternate between up 
>> and down).
> 
> At a wild guess, I'd suspect you neglected to bind the table's Sort 
> Descriptors binding to the array controller's "sortDescriptors" property. 
> This probably happens automatically for a cell-based table view, but perhaps 
> (like the Content binding) needs to be done explicitly for a view-based table 
> view.

You are correct. I added this binding.
And I also set the TableColumn to:
Sort Key = Name
Selector = localizedCaseInsensitiveCompare:

Both seem to be necessary.

> 
>> What am I missing?
> 
> Possibly that using bindings with a view-based table view is more trouble 
> than it's worth? (I don't mean bindings to the cell view's objectValue. 
> That's worth doing.) But I digress…

My experience with TableViews is: I usually start with bindings, but when 
things start getting a bit more complicated (they usually do) I switch back to 
DataSource. Slightly more code, much less head-ache.

But this project is just about learning.

Thanks for your help!


Kind regards,

Gerriet.

___

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

UIGestureRecognizers for 2-6?

2013-05-02 Thread Eric E. Dolecki
Hi all,

I am looking for subclassed UIGestureRecogizers for numerals 2, 3, 4, 5, 6.
I am simply looking to save some time by plugging in these recognizers if
any has any laying around or knows where I can get some (without doing the
JSON thing).

Thanks for any consideration,
Eric
___

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: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Fritz Anderson
On 1 May 2013, at 7:10 AM, Motti Shneor  wrote:

> - Each MyA instance. creates and owns a MyB instance. 
> - MyB instances create an NSThread, and live their asynchronous life, 
> communicating with a remote internet server, and  sometimes with their owner 
> (the MyA object) who lives in the main thread.
> 
> - It can happen that MyA wants to dispose of its MyB, (in the main thread), 
> and replace it with another instance of MyB.
> - However, MyB cannot be released instantaneously, or synchronously, because 
> its thread should gracefully close and disconnect from the server, which 
> takes long seconds and even more.
> 
> Currently, MyB retains itself within its thread, and releases itself just 
> before the thread exits. I know it is bad practice (self retaining objects), 
> but I did not yet think of a better way. 

Probably this is a solved problem, and I'm talking through my hat. As a matter 
of first impression…

I'd try a broker object. When the MyA is done with the MyB, it hands the MyB 
over to the broker, which handles the negotiations with the MyB to wind it up, 
then releases the MyB: 

MyA:
hand the MyB over to the broker.
Broker:
is the MyB already finished? Do nothing and return. Otherwise:
retain the MyB (by keeping it in a mutable array?)
tell the MyB that the broker needs a callback when MyB is done 
(that is, assign the broker as a delegate for this purpose)
tell the MyB to wind itself up
release the MyB and replace it with a new one
MyB:
complete the windup (which may already have happened)
tell the broker it's done
Broker:
release the MyB

I tried sketching it out, but I wasn't going to resolve all the locking and 
threading issues in the time I can give an email.

If it works at all, it solves the self-release problem, it gives you a 
one-stop-shopping place to put the asynchrony issues, and I think it handles 
the irreducible tasks of stopping and disposing of a task the owner no longer 
wants to deal with.

— F

-- 
Fritz Anderson
Xcode 4 Unleashed: 4.5 supplement for free!
http://www.informit.com/store/xcode-4-unleashed-9780672333279


___

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: NSWindow - flickering shadow during height animation (borderless, transparent)

2013-05-02 Thread Robert Vojta
Okay, so, here's the solution … The problem was in this …

Wrong way

I was listening for contentView frame changes 
(NSViewDidChangeFrameNotification) and I was calling display/invalidateShadow 
whenever I receieved this notification.

Correct way

NSWindowDelegate has windowDidResize notification. I moved 
display/invalidateShadow there and it stops flickering and works perfectly 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: Built-in Activity Types

2013-05-02 Thread Matt Neuburg
On Wed, 01 May 2013 12:59:48 -0600, koko  said:
>I should also note that I want to add my custom activities as well and 
>understand I need to subclass UIActivity but some details would be helpful.

Same answer:

http://www.apeth.com/iOSBook/ch26.html#_activity_view

m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do

___

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: Double tap inside a UICollectionViewCell

2013-05-02 Thread Matt Neuburg
On Wed, 01 May 2013 18:23:10 -0600, koko  said:
>The code below from Collection View Programming Guide for iOS: Incorporating 
>Gesture Support does not work as expected.  Is there something Apple has left 
>out?
>
>Does not work as expected means @selector(handleTapGesture:)is not called if a 
>double tap occurs in a UICollectionViewCell.  @selector(handleTapGesture:) is 
>called if the double tap occurs outside a UICollectionViewCell.
>
>The question is how to get a double tap inside a UICollectionViewCell.
>
>[self.collectionView addGestureRecognizer:tapGesture];
>

Well obviously if you want to detect double taps on a collection view *cell*, 
it might be simplest to attach the gesture recognizer to the collection view 
*cell* (not the collection view itself). m.
 
--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do

___

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: Double tap inside a UICollectionViewCell

2013-05-02 Thread koko

On May 2, 2013, at 10:35 AM, Matt Neuburg  wrote:

> Well obviously if you want to detect double taps on a collection view *cell*, 
> it might be simplest to attach the gesture recognizer to the collection view 
> *cell* (not the collection view itself). m.

From the UICollectionView Programming Guide page 34:

You should always attach your gesture recognizers to the collection view itself 
and not to a specific cell or view. The UICollectionView class is a descendant 
of UIScrollView. Attaching your gesture recognizers to the collection view is 
less likely to interfere with the other gestures that must be tracked. In 
addition, because the collection view has access to your data source and your 
layout object, you still have access to all the information you need to 
manipulate cells and views appropriately.



I aint toopid and I kin reed  … 


-koko
___

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: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Jens Alfke

On May 1, 2013, at 5:10 AM, Motti Shneor  wrote:

> Currently, MyB retains itself within its thread, and releases itself just 
> before the thread exits. I know it is bad practice (self retaining objects), 
> but I did not yet think of a better way. 
> 
> This way, when the owner releases its MyB and replaces its reference with a 
> new MyB object, the MyB is just released once, and does not get deallocated. 
> When its thread finishes its cycle in the background, the thread function 
> releases the objects again, and returns.

That's fine, IMHO, and I've both read and written code that does this.

—Jens
___

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: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Kyle Sluder
On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote:
> Hello. 
> 
> I have two NSObject subclasses -  say MyA and MyB.
> 
> - Each MyA instance. creates and owns a MyB instance. 
> - MyB instances create an NSThread, and live their asynchronous life,
> communicating with a remote internet server, and  sometimes with their
> owner (the MyA object) who lives in the main thread.

Dumb question: can you not rely on Cocoa's built-in asynchronous
networking APIs?

> What's the best way to get out of this? How can I simply synchronize the
> "release" calls, without blocking both threads? Maybe I should restrict
> myself to retaining/releasing in the main thread only? Is there some
> syntactic Obj-C sugar to ease such things?

In such a circumstance, I would normally require MyA to use a factory
method to construct instances of MyB, and have that factory method add
the MyB instances to an object pool. When MyB operations are cancelled,
they perform their cleanup and message the thread they were created on
to remove themselves from the pool. Using dispatch queues should
simplify this quite a bit.

--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: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hi and thanks Kyle, Fritz, Jens and everyone else 

On 2 במאי 2013, at 20:31, Kyle Sluder  wrote:

> On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote:
>> Hello. 
>> 
>> I have two NSObject subclasses -  say MyA and MyB.
>> 
>> - Each MyA instance. creates and owns a MyB instance. 
>> - MyB instances create an NSThread, and live their asynchronous life,
>> communicating with a remote internet server, and  sometimes with their
>> owner (the MyA object) who lives in the main thread.
> 
> Dumb question: can you not rely on Cocoa's built-in asynchronous
> networking APIs?

Unfortunately, MyB wraps in Obj-C a (rather weird) 15 year old C++ socket 
implementation which is nonstandard in many ways, and therefore cannot use the 
nicer and more modern asynchronous networking APIs. 

> 
>> What's the best way to get out of this? How can I simply synchronize the
>> "release" calls, without blocking both threads? Maybe I should restrict
>> myself to retaining/releasing in the main thread only? Is there some
>> syntactic Obj-C sugar to ease such things?
> 
> In such a circumstance, I would normally require MyA to use a factory
> method to construct instances of MyB, and have that factory method add
> the MyB instances to an object pool. When MyB operations are cancelled,
> they perform their cleanup and message the thread they were created on
> to remove themselves from the pool. Using dispatch queues should
> simplify this quite a bit.
> 

That doesn't change the problem much, because now the "object pool" will have 
the same issues as MyA. The problem is in the multithreaded 
allocation/deallocation domain. 

However, I think I found a good workaround the problem. 

If MyB calls [self retain] just BEFORE detaching its thread-function, and then 
calls [self release] AFTER the thread exits, and the thread-function returns, 
then all retain and release (hence dealloc) calls happen in the main-thread, 
and thus --- synchronized. 

I think I solved the problem. but now I'll exercise this code heavily, to see 
it is good. 

Last word --- I wonder why it isn't clearly written for every cocoa API (and 
especially for the very fundamental initialize/alloc/init/release/dealloc 
methods whether or not they're reentrant! In a multithreaded environment, 
that's a reasonable requirement from the documentation.

Thanks again!

Motti Shneor, Mac OS X Software Architect & Team Leader
Spectrum Reflections Ltd.


___

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: NSOutlineView Travails

2013-05-02 Thread Corbin Dunn

On Apr 17, 2013, at 2:09 PM, Quincey Morris 
 wrote:

> On Apr 17, 2013, at 10:50 , Gordon Apple  wrote:
> 
>> We are converting tables and outlines to view-based.  So far, so good, on
>> tables.  But NSOutlineView has been a pain.  First of all, there is no
>> documentation on this, zero, zip, nada, zilch, in the NSOutlineView
>> Reference.  You have to rely on sample code and NSOutlineView.h.
> 
> Yup, the documentation situation for NSOutlineView is awful.

You should log bugs at bugreporter.apple.com asking for specific things you 
would like to see better. Please be specific; general statements like "X is 
terrible" don't help us know what you are wanting to know. A better thing would 
be to say "I don't understand how to begin editing in NSOutlineView.." or "it 
took me a long time to figure out XX, and it should be documented".

corbin

> 
>> Our outline view has a column/cell identifier ³LineNumber², one for
>> ³CheckBox², one for ³Outline².  Previously, the latter two were bound to our
>> NSTreeController.  Converting to views (yes, using
>> outlineView:viewForTableColumn:item:), we could not even get the nib to
>> load.  ObjectValue always came up nil.  We tried binding the tableView to
>> the tree controller ‹ still nil.  
> 
> You can't "try" binding here. If you're using a data source, you don't bind 
> the outline view to the tree controller, and in that case you need to set 
> view.objectValue to the desired object before returning from 
> 'outlineView:viewForTableColumn:item:'.
> 
> Otherwise, you *must* bind the outline view's "content" binding to the tree 
> controller, and the outline view should then maintain "objectValue" for you. 
> (But since I always use data sources these days, I can't swear that this is 
> precisely correct.)
> 
>> Ok, after examining sample code, we
>> decided that just maybe there was something magic about the column/cell
>> identifier ³MainCell², so we changed our third column/cell identifier and
>> replaced @²Outline² with @²MainCell² in our code.  Amazing ‹ now the nib
>> loads.  However, still no values.
> 
> Since you're talking about loading nibs, I assume you've got code to register 
> the nib, and I bet you forgot to ensure that the nib is registered with with 
> the identifier that matches what you're actually using.
> 
> If I remember the details correctly, you're going to invoke 
> 'makeViewWithIdentifier:owner:' inside 
> 'outlineView:viewForTableColumn:item:'. When you're using registered nibs, 
> you must use the identifier that the nib is registered under, and the 
> identifier assigned to the built-in cell view (that you're not using) is 
> irrelevant. When you're using the built-in cell view, you must use its 
> identifier, of course.
> 
> The column identifier is basically unrelated, unless you *choose* to 
> configure it to match the actual cell view identifier. The table view 
> documentation assumes this is desirable, but I've never found it makes 
> anything much easier. All it does is provide the opportunity for things to 
> get out of sync, as you discovered.
> 
>> Even worse, the turn-down dingy appears
>> in the first column, not the third where we want it.  It does turn down the
>> right number of times and depths to match our outline, but is in the wrong
>> place and no values.
>> 
>> So how do I get the outline back into the third column and get my
>> objectValues to work?
> 
> Are you sure you aren't inadvertently returning a group row view, or a 
> full-row view?
> 
> ___
> 
> 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/corbind%40apple.com
> 
> This email sent to corb...@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

Re: NSOutlineView Travails

2013-05-02 Thread Corbin Dunn

On Apr 21, 2013, at 11:51 AM, Gordon Apple  wrote:

> Our view-based NSOutlineView still has a few annomalies, but mostly works.
> Now, we are attempting to install a hoverView in our outline column to
> launch a popover (display only) when mousing over a row.  This works just
> fine with NSTableViews, but so far does not work at all with NSOutlineView.
> We had hoped this would not be a problem because NSOutlineView is a subclass
> of NSTableView.  Our theory is that because the presence of turn-down
> buttons in the outline view, there must be an additional intervening view
> that handle this and related layout issues within the cell.  Has anyone
> successfully used a hoverView with NSOutlineView?

No, there isn't any additional intervening of the views. Visually, the view 
based NSOutlineView is a super-thin wrapper around NSTableView to add 
indentation and a disclosure triangle. If it works in NSTableView, it will work 
in NSotulineView, and something else is likely wrong.

Things that would be useful to know:
1. How you are trying to show a popover. (i.e.: relevant code)
2. When you are doing it, and when is it not happening

> 
> BTW, a word to the wise.  Bindings to arrayControllers through a
> viewController¹s representedObject is still problematic.  We have filed bug
> reports on this in the past (confirmed bug).

What is the radar you logged for this?

NSTableView and NSOutlineView doesn't use a viewController.

corbin


___

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: Field editor in view-based table

2013-05-02 Thread Corbin Dunn

On Apr 12, 2013, at 10:58 PM, Martin Hewitson  
wrote:

> Dear list members,
> 
> I have an NSTextField in a row view of a view-based tableview and I see the 
> following behavior:
> 
> 1)  to get the field editor to show I have to single click the text field and 
> wait about 1s.  
> 2) The field editor only shows if I click on a part of the text field where 
> this is text already, but if I click to the right of the current text (but 
> still within the text field) nothing happens. 
> 3) Double-clicking directly in the textfield does nothing.
> 4) If the row is not selected, and I single click in the textfield, the row 
> is selected, but the field editor is not shown
> 
> Is this all expected behaviour? I've tried googling but don't find much 
> discussion on view-based tableviews apart from the examples from Apple. Is 
> there some magic I can do to make the textfield subviews respond (show a 
> field editor) more promptly?
> 
> It makes the UI very unresponsive.

Yes, this is expected, and it is the way Finder also works. Well, finder's 
double click action is set to open the file/app.

corbin





___

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: NSOutlineView Travails

2013-05-02 Thread Quincey Morris
On May 2, 2013, at 14:52 , Corbin Dunn  wrote:

> On Apr 17, 2013, at 2:09 PM, Quincey Morris 
>  wrote:
> 
>> On Apr 17, 2013, at 10:50 , Gordon Apple  wrote:
>> 
>>> We are converting tables and outlines to view-based.  So far, so good, on
>>> tables.  But NSOutlineView has been a pain.  First of all, there is no
>>> documentation on this, zero, zip, nada, zilch, in the NSOutlineView
>>> Reference.  You have to rely on sample code and NSOutlineView.h.
>> 
>> Yup, the documentation situation for NSOutlineView is awful.
> 
> You should log bugs at bugreporter.apple.com asking for specific things you 
> would like to see better. Please be specific; general statements like "X is 
> terrible" don't help us know what you are wanting to know. A better thing 
> would be to say "I don't understand how to begin editing in NSOutlineView.." 
> or "it took me a long time to figure out XX, and it should be documented".

Yes, I know. But Gordon already said the specific thing: "there is no 
documentation on [view-based outline views], zero, zip, nada, zilch".

This isn't just about programming guides. The delegate method 
'outlineView:viewForTableColumn:item:' isn't even mentioned in the 
NSOutlineViewDelegate protocol reference documentation. Zero, zip, nada, zilch.

Under the circumstances, I think it's a little hilarious to be asked to 
meticulously bug-report what will "'help us know what you are wanting to know".

___

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: NSOutlineView Travails

2013-05-02 Thread Gordon Apple
We did get a customRowView to work in the TableViewPlayground sample.  The
popover showed a simple color image view with some text that displayed the
row number.  As you mouse over the outline, any previous popover closes and
a new one appears at the edge of the outline/table view row.

I filed a request to document the view-based methods for NSOutlineView.

Our outlines and tables are contained in view nibs using view controllers.
For the tables, the array controllers are chained in the view-nib containing
the tables-view nibs, so each table is bound to an array controller outside
its own nib.  Binding it through the view controller¹s representedObject
(set to the appropriate array controller) doesn¹t work, so we just bound
them directly in the master view-nib¹s view controller code.

In our own code, the customRowView proved deadly.  We are currently engaged
in a TSI to try to resolve this and the other issues.

BTW, DTS asked for a complete project. We were going to send in our project
code, until we went back and read the Apple, Inc. Developer Agreement.  Not
only is there no NDA or intellectual property protection for developers, it
explicitly (essentially) states that, once you send it in, they can do
anything they darn well want to with it.  So we are now trying to reproduce
a project with only that slice of code in it.  Beware!  As someone who is
very experienced with the patent process, I can tell you that if you have
anything patentable in your code, the simple act of sending it to DTS (with
no NDA) can be construed as a disclosure, and can form a statuary bar to you
ever getting a patent on it.

³You agree that when requesting and receiving TECHNICAL SUPPORT FROM DTS
SeRVICES, you will not provide Apple with any INFORMATION, including that
incorporated in your software, that is confidential to you or any third
party. YOU AGREE THAT Any notice, legend, or label to the contrary contained
in any SUCH materials provided by you to Apple shall be without effect.
Apple shall be free to use all information it receives from you in any
manner it deems appropriate, subject to any applicable patents or
copyrights.²


On 5/2/13 4:55 PM, "Corbin Dunn"  wrote:

> 
> On Apr 21, 2013, at 11:51 AM, Gordon Apple  wrote:
> 
>> > Our view-based NSOutlineView still has a few annomalies, but mostly works.
>> > Now, we are attempting to install a hoverView in our outline column to
>> > launch a popover (display only) when mousing over a row.  This works just
>> > fine with NSTableViews, but so far does not work at all with NSOutlineView.
>> > We had hoped this would not be a problem because NSOutlineView is a
>> subclass
>> > of NSTableView.  Our theory is that because the presence of turn-down
>> > buttons in the outline view, there must be an additional intervening view
>> > that handle this and related layout issues within the cell.  Has anyone
>> > successfully used a hoverView with NSOutlineView?
> 
> No, there isn't any additional intervening of the views. Visually, the view
> based NSOutlineView is a super-thin wrapper around NSTableView to add
> indentation and a disclosure triangle. If it works in NSTableView, it will
> work in NSotulineView, and something else is likely wrong.
> 
> Things that would be useful to know:
> 1. How you are trying to show a popover. (i.e.: relevant code)
> 2. When you are doing it, and when is it not happening
> 
>> > 
>> > BTW, a word to the wise.  Bindings to arrayControllers through a
>> > viewController¹s representedObject is still problematic.  We have filed bug
>> > reports on this in the past (confirmed bug).
> 
> What is the radar you logged for this?
> 
> NSTableView and NSOutlineView doesn't use a viewController.
> 
> corbin
> 


___

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: NSOutlineView Travails

2013-05-02 Thread Corbin Dunn

On May 2, 2013, at 3:15 PM, Quincey Morris 
 wrote:

> On May 2, 2013, at 14:52 , Corbin Dunn  wrote:
> 
>> On Apr 17, 2013, at 2:09 PM, Quincey Morris 
>>  wrote:
>> 
>>> On Apr 17, 2013, at 10:50 , Gordon Apple  wrote:
>>> 
 We are converting tables and outlines to view-based.  So far, so good, on
 tables.  But NSOutlineView has been a pain.  First of all, there is no
 documentation on this, zero, zip, nada, zilch, in the NSOutlineView
 Reference.  You have to rely on sample code and NSOutlineView.h.
>>> 
>>> Yup, the documentation situation for NSOutlineView is awful.
>> 
>> You should log bugs at bugreporter.apple.com asking for specific things you 
>> would like to see better. Please be specific; general statements like "X is 
>> terrible" don't help us know what you are wanting to know. A better thing 
>> would be to say "I don't understand how to begin editing in NSOutlineView.." 
>> or "it took me a long time to figure out XX, and it should be documented".
> 
> Yes, I know. But Gordon already said the specific thing: "there is no 
> documentation on [view-based outline views], zero, zip, nada, zilch".
> 
> This isn't just about programming guides. The delegate method 
> 'outlineView:viewForTableColumn:item:' isn't even mentioned in the 
> NSOutlineViewDelegate protocol reference documentation. Zero, zip, nada, 
> zilch.
> 
> Under the circumstances, I think it's a little hilarious to be asked to 
> meticulously bug-report what will "'help us know what you are wanting to 
> know".

There isn't zero documentation; 95% of the functionality comes from 
NSTableView, which is well documented. The outline view methods are really just 
cover methods for the NSTableView ones. 

But like I said, please log a bug requesting it be documented. Your specific 
case here would be to document the view based outline view delegate methods.  
But to be fair, the header is fairly verbose (well, terse in the case for those 
methods...because they are just cover methods  as I said).

corbin




___

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: NSOutlineView Travails

2013-05-02 Thread Corbin Dunn

On May 2, 2013, at 3:44 PM, Gordon Apple  wrote:

> We did get a customRowView to work in the TableViewPlayground sample.  The 
> popover showed a simple color image view with some text that displayed the 
> row number.  As you mouse over the outline, any previous popover closes and a 
> new one appears at the edge of the outline/table view row.
> 
> I filed a request to document the view-based methods for NSOutlineView.
> 
> Our outlines and tables are contained in view nibs using view controllers.  
> For the tables, the array controllers are chained in the view-nib containing 
> the tables-view nibs, so each table is bound to an array controller outside 
> its own nib.  Binding it through the view controller’s representedObject (set 
> to the appropriate array controller) doesn’t work, so we just bound them 
> directly in the master view-nib’s view controller code.
> 
> In our own code, the customRowView proved deadly.  We are currently engaged 
> in a TSI to try to resolve this and the other issues.
> 
> BTW, DTS asked for a complete project. We were going to send in our project 
> code, until we went back and read the Apple, Inc. Developer Agreement.  Not 
> only is there no NDA or intellectual property protection for developers, it 
> explicitly (essentially) states that, once you send it in, they can do 
> anything they darn well want to with it.  So we are now trying to reproduce a 
> project with only that slice of code in it.  Beware!  As someone who is very 
> experienced with the patent process, I can tell you that if you have anything 
> patentable in your code, the simple act of sending it to DTS (with no NDA) 
> can be construed as a disclosure, and can form a statuary bar to you ever 
> getting a patent on it.

I'm not really the right person to be talking to about these issues; if you 
have problems with the DTS service agreement, please contact DTS about it. 

However, it is hard for DTS (and people here on the forums/group) to help 
unless there is enough information. Frequently, that will entail looking at 
your project, or, even more ideally, isolate your problem to a test case that 
reproduces the issue; then, you don't have to send your entire project. Often 
times, I find that people discover the answer to their problem when trying to 
isolate it.

corbin


> 
> “You agree that when requesting and receiving TECHNICAL SUPPORT FROM DTS 
> SeRVICES, you will not provide Apple with any INFORMATION, including that 
> incorporated in your software, that is confidential to you or any third 
> party. YOU AGREE THAT Any notice, legend, or label to the contrary contained 
> in any SUCH materials provided by you to Apple shall be without effect. Apple 
> shall be free to use all information it receives from you in any manner it 
> deems appropriate, subject to any applicable patents or copyrights.”
> 
> 
> On 5/2/13 4:55 PM, "Corbin Dunn"  wrote:
> 
>> 
>> On Apr 21, 2013, at 11:51 AM, Gordon Apple  wrote:
>> 
>> > Our view-based NSOutlineView still has a few annomalies, but mostly works.
>> > Now, we are attempting to install a hoverView in our outline column to
>> > launch a popover (display only) when mousing over a row.  This works just
>> > fine with NSTableViews, but so far does not work at all with NSOutlineView.
>> > We had hoped this would not be a problem because NSOutlineView is a 
>> > subclass
>> > of NSTableView.  Our theory is that because the presence of turn-down
>> > buttons in the outline view, there must be an additional intervening view
>> > that handle this and related layout issues within the cell.  Has anyone
>> > successfully used a hoverView with NSOutlineView?
>> 
>> No, there isn't any additional intervening of the views. Visually, the view 
>> based NSOutlineView is a super-thin wrapper around NSTableView to add 
>> indentation and a disclosure triangle. If it works in NSTableView, it will 
>> work in NSotulineView, and something else is likely wrong.
>> 
>> Things that would be useful to know:
>> 1. How you are trying to show a popover. (i.e.: relevant code)
>> 2. When you are doing it, and when is it not happening
>> 
>> > 
>> > BTW, a word to the wise.  Bindings to arrayControllers through a
>> > viewController’s representedObject is still problematic.  We have filed bug
>> > reports on this in the past (confirmed bug).
>> 
>> What is the radar you logged for this?
>> 
>> NSTableView and NSOutlineView doesn't use a viewController.
>> 
>> corbin
>> 
> 
> 

___

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

delaying forced sleep after initial 30 seconds delay

2013-05-02 Thread Nick Rogers
Hi,

I want my app to delay forced sleep even after requesting the initial delay of 
30 seconds.
This have to be specifically set by the user in the Preferences of the app and 
only when the user clicks  a button to run some operation, for the duration of 
that operation which could extent to a minute or two.

I know it would be against the mac os x design principles, but I think in the 
end it has to be the user's wish.

I have seen my macbook pro sometime taking more than 2 minutes to go into 
sleep, after closing the lid. So is this possible at all?

The scenario is that user has set the preference to delay forced sleep and then 
he clicks the button on the app and then closes the laptop lid, knowing fully 
well that it may delay sleep for a few minutes.

Wishes,
Nick
___

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: delaying forced sleep after initial 30 seconds delay

2013-05-02 Thread Quincey Morris
On May 2, 2013, at 21:16 , Nick Rogers  wrote:

> I want my app to delay forced sleep even after requesting the initial delay 
> of 30 seconds.
> This have to be specifically set by the user in the Preferences of the app 
> and only when the user clicks  a button to run some operation, for the 
> duration of that operation which could extent to a minute or two.
> 
> I know it would be against the mac os x design principles, but I think in the 
> end it has to be the user's wish.
> 
> I have seen my macbook pro sometime taking more than 2 minutes to go into 
> sleep, after closing the lid. So is this possible at all?

It's worth watching the 2012 WWDC session video on Power Management. The 
relevant APIs are here:


https://developer.apple.com/library/mac/#documentation/IOKit/Reference/IOPMLib_header_reference/Reference/reference.html

I don't see any reason to think this violates any Mac design principles.

___

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: delaying forced sleep after initial 30 seconds delay

2013-05-02 Thread Kyle Sluder
On Thu, May 2, 2013, at 09:16 PM, Nick Rogers wrote:
> Hi,
> 
> I want my app to delay forced sleep even after requesting the initial
> delay of 30 seconds.

Forced sleep exists for cases in which keeping the machine awake can
cause hardware failure.

> 
> I have seen my macbook pro sometime taking more than 2 minutes to go into
> sleep, after closing the lid. So is this possible at all?

This shouldn't happen. It's a bad thing when it does. So the system is
designed to prevent you from causing it to happen.

Please don't try to give your users a "Ruin My Hardware" checkbox.

--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


Enable Unique Selection

2013-05-02 Thread Gerriet M. Denkmann
I have a button which only makes sense when exactly one thing is selected.
Currently it's Enabled property is bound to Array 
Controller.selectedObjects.@count.
I.e. the button is enabled if one or more things are selected.

But I want it to be disabled when nothing is selected AND also if more than one 
thing is selected.
Is there a way to do this without code?

If not - what to do ? Create a value transformer? Or what else?

Gerriet.


___

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