Selecting UITableViewCell programmatically?
I want to make a now playing button for my radio application. So would like to know how can I select a row programmatically I thought of calling didSelectRowAtIndexPath method but apparently we can't call it.
objective-c cocoa-touch ios uitableview ios4
add a comment |
I want to make a now playing button for my radio application. So would like to know how can I select a row programmatically I thought of calling didSelectRowAtIndexPath method but apparently we can't call it.
objective-c cocoa-touch ios uitableview ios4
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14
add a comment |
I want to make a now playing button for my radio application. So would like to know how can I select a row programmatically I thought of calling didSelectRowAtIndexPath method but apparently we can't call it.
objective-c cocoa-touch ios uitableview ios4
I want to make a now playing button for my radio application. So would like to know how can I select a row programmatically I thought of calling didSelectRowAtIndexPath method but apparently we can't call it.
objective-c cocoa-touch ios uitableview ios4
objective-c cocoa-touch ios uitableview ios4
edited Dec 28 '18 at 7:35
Cœur
17.5k9103145
17.5k9103145
asked Jun 2 '11 at 4:59
Tushar ChutaniTushar Chutani
78652047
78652047
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14
add a comment |
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14
add a comment |
2 Answers
2
active
oldest
votes
didSelectRowAtIndexPath is the method from delegate and it's called when you touch (select) the row in UITableView
Use below method to selct a row on your UITableView
instance.
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
See Sample code.
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
add a comment |
There is tableView method like [tableView selectRowAtIndexPath:anIndexPathObject animated:BOOL-Flag]; .By calling this method you can select the row programmatically. But you also need to create an index path object.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f6210600%2fselecting-uitableviewcell-programmatically%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
didSelectRowAtIndexPath is the method from delegate and it's called when you touch (select) the row in UITableView
Use below method to selct a row on your UITableView
instance.
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
See Sample code.
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
add a comment |
didSelectRowAtIndexPath is the method from delegate and it's called when you touch (select) the row in UITableView
Use below method to selct a row on your UITableView
instance.
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
See Sample code.
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
add a comment |
didSelectRowAtIndexPath is the method from delegate and it's called when you touch (select) the row in UITableView
Use below method to selct a row on your UITableView
instance.
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
See Sample code.
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
didSelectRowAtIndexPath is the method from delegate and it's called when you touch (select) the row in UITableView
Use below method to selct a row on your UITableView
instance.
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
See Sample code.
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
answered Jun 2 '11 at 5:07
JhaliyaJhaliya
30.7k66774
30.7k66774
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
add a comment |
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
tried that but that isn't working...it again reloads the view I mean the mp3 streamer I am using is re started...
– Tushar Chutani
Jun 2 '11 at 7:02
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
@Tushar Chutani : if you try to reload the table again, you would loose the last selected row ..
– Jhaliya
Jun 2 '11 at 7:36
add a comment |
There is tableView method like [tableView selectRowAtIndexPath:anIndexPathObject animated:BOOL-Flag]; .By calling this method you can select the row programmatically. But you also need to create an index path object.
add a comment |
There is tableView method like [tableView selectRowAtIndexPath:anIndexPathObject animated:BOOL-Flag]; .By calling this method you can select the row programmatically. But you also need to create an index path object.
add a comment |
There is tableView method like [tableView selectRowAtIndexPath:anIndexPathObject animated:BOOL-Flag]; .By calling this method you can select the row programmatically. But you also need to create an index path object.
There is tableView method like [tableView selectRowAtIndexPath:anIndexPathObject animated:BOOL-Flag]; .By calling this method you can select the row programmatically. But you also need to create an index path object.
answered Jun 2 '11 at 5:06
Rahul VyasRahul Vyas
15.8k47163238
15.8k47163238
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f6210600%2fselecting-uitableviewcell-programmatically%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you please be specific ? You want a row to be selected - and you do not want to use didSelectRowAtIndexPath ???
– Legolas
Jun 2 '11 at 5:02
Okay here is what I have thought...when ever the user hits the now playing button the row that was last selected will be selected back again taking back to the now playing view....makes scenes?
– Tushar Chutani
Jun 2 '11 at 5:14