M
M
Maxim Degtyarev2016-06-11 18:02:12
Objective-C
Maxim Degtyarev, 2016-06-11 18:02:12

How to loop tableView?

Two questions.
1. How can I make it so that being on the last line of the tableView, and clicking on the down arrow to get to the first line and vice versa? I tried to use the keyDown method, but it does not respond to pressing the up and down arrows, but it does respond to the left and right arrows.
2. I'm making an application that will open in the top menu with a hot key. The window that opens will have a text field. So here's how to make sure that when the window opens, the focus is already on the text field and you can immediately enter characters into it without poking at it first?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cassar, 2016-06-17
@This_man

To programmatically scroll a UITableView try -scrollToRowAtIndexPath:atScrollPosition:animated: and to set focus to the input field -becomeFirstResponder.

J
Julia Vashchenko, 2016-06-17
@aronskaya

1. Try the performKeyEquivalent: method (inherited from NSResponder).
2. All NSControls have a method - performClick:
Or, alternatively, you can send a mouseDown:
I hope some of this helps )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question