Re: Triggering UITableView's -didSelectRowAtIndexPath: delegate callback

2016-02-28 Thread Jens Alfke

>> On Feb 27, 2016, at 4:27 PM, Keary Suska > > >> wrote:
>> 
>>  This results in a much more reliable and extensible decoupling since no 
>> other object should know those internal signaling mechanics and should have 
>> confidence that any other object interested in the selection will be 
>> dutifully notified. In fact, this is how NSTableView works. Why UITableView 
>> doesn’t, seems worthy of a radar.

NSTableView doesn’t work that way. Changing the selection programmatically does 
not trigger a selection-changed notification / delegate callback.

—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: Triggering UITableView's -didSelectRowAtIndexPath: delegate callback

2016-02-28 Thread Luke Hiesterman
It is a general design pattern of all of UIKit - not just UITableView - that 
delegate callbacks for user actions are not triggered when those same actions 
are done programmatically. If you’re going to file a bug, I suggest filing it 
on the entire UIKit design pattern.

Luke

On Feb 27, 2016, at 4:27 PM, Keary Suska 
mailto:cocoa-...@esoteritech.com>> wrote:


On Feb 27, 2016, at 3:59 PM, Ben Kennedy 
mailto:b...@zygoat.ca>> wrote:


On 27 Feb 2016, at 11:17 am, Carl Hoefs 
mailto:newsli...@autonomy.caltech.edu>> wrote:

Yes, that works, thanks! I just thought there might be a "preferred" way to do 
it. I guess I was hoping for something like:

[myTableView selectRowAtIndexPath:indexPath
  animated:YES
scrollPosition:UITableViewScrollPositionMiddle
  triggersDelegateCallback:YES];

What gain would that afford you, though?

I believe that the table view API is designed this way to afford the programmer 
control and flexibility. Perhaps your didSelectRow:... implementation calls 
some private method to do the business logic, say -[self fireTheRockets]. In 
that case, you could simply call fireTheRockets directly here instead.

By contrast, the delegate API provides your code a means to act on external 
events (user input) brokered by the table view. Perhaps in such a case there is 
additional UI-related work not suitable for inclusion in fireTheRockets.

This decoupling enables you to separate these concerns.


Except that it doesn’t follow. There is no design necessity that the object 
programmatically setting the selection is the same object as the delegate, nor 
that those two objects know anything about each other. Also if a delegate 
implements such a delegate call it is signaling that it needs to know every 
selection change regardless of how it is accomplished (since it has not way of 
knowing in advance how it was accomplished, unless you decide to couple the two 
objects). This results in a much more reliable and extensible decoupling since 
no other object should know those internal signaling mechanics and should have 
confidence that any other object interested in the selection will be dutifully 
notified. In fact, this is how NSTableView works. Why UITableView doesn’t, 
seems worthy of a radar.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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

Re: windowDidLoad getting called twice?

2016-02-28 Thread Dave
Hi,

I found the problem, it was in the Class above the one where I as looking, very 
confusing as the debugger is a bit glitchy in this area and wouldn’t let me 
Step Into/Out of properly…..

Thanks for the help, All the Best
Dave


___

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: windowDidLoad getting called twice?

2016-02-28 Thread Dave

> On 28 Feb 2016, at 17:55, Keary Suska  wrote:
> 
> 
>> On Feb 28, 2016, at 8:10 AM, Dave  wrote:
>> 
>> the winddowDidLoad method of my Window Controller is getting called twice. 
>> Is this expected behaviour? The window is the NIB has no views setup in the 
>> window ContentView, I add them after the window NIB has loaded. I’m guessing 
>> the second call is when I add subviews to the Content View…..
> 
> As I understand, no. No need to guess—set a break point and know.
> 

I have, it’s getting called twice, and I think I now know why, this is the 
windowDidLoadMethod

-(void) windowDidLoad 
{
LTWWindowBase*  myWindow;

//[super windowDidLoad];

myWindow = (LTWWindowBase*) self.window;
[myWindow initializeWindowWithWindowController:self];
}


It’s being called when I access the self.window, which is not surprising 
because accessing .window the first time triggers the loadWindow methods etc. I 
guess I can’t access .window from this method? The 
initializeWindowWithWindowController method adds the initial views to the 
Content View, is there another method where it is safe to do this? I suppose I 
could schedule it to run a short time after windowDidLoad has returned? What’s 
the recommended way of doing this?

Thanks for your help.

All the Best
Dave


___

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: windowDidLoad getting called twice?

2016-02-28 Thread Keary Suska

> On Feb 28, 2016, at 8:10 AM, Dave  wrote:
> 
> the winddowDidLoad method of my Window Controller is getting called twice. Is 
> this expected behaviour? The window is the NIB has no views setup in the 
> window ContentView, I add them after the window NIB has loaded. I’m guessing 
> the second call is when I add subviews to the Content View…..

As I understand, no. No need to guess—set a break point and know.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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

windowDidLoad getting called twice?

2016-02-28 Thread Dave
Hi,

the winddowDidLoad method of my Window Controller is getting called twice. Is 
this expected behaviour? The window is the NIB has no views setup in the window 
ContentView, I add them after the window NIB has loaded. I’m guessing the 
second call is when I add subviews to the Content View…..

All the Best
Dave


___

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: What is the difference between vertical and horizontal views in iOS?

2016-02-28 Thread Lee Ann Rucker
It depends entirely on how you want to lay out your UI. Do you want
[a] [b] [c]

or

[a]
[b]
[c]
?

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of 
nicholasacosta...@gmail.com [nicholasacosta...@gmail.com]
Sent: Saturday, February 27, 2016 7:25 PM
To: cocoa-dev@lists.apple.com
Subject: What is the difference between vertical and horizontal views in iOS?

Sent from my iPhone hi, I want to know if I should use a vertical or a 
horizontal view in an iOS app that I am trying to write. Basically, I am using 
stack views. What is the difference between these two views? If I use a 
vertical or horizontal view, what will happen to my app? Is it better to use 
one over the other?

Thank U.
___

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/lrucker%40vmware.com

This email sent to lruc...@vmware.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