Selecting UITableViewCell programmatically?












0














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.










share|improve this question
























  • 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
















0














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.










share|improve this question
























  • 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














0












0








0







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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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












2 Answers
2






active

oldest

votes


















1














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





share|improve this answer





















  • 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



















0














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.






share|improve this answer





















    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    1














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





    share|improve this answer





















    • 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
















    1














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





    share|improve this answer





















    • 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














    1












    1








    1






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





    share|improve this answer












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






    share|improve this answer












    share|improve this answer



    share|improve this answer










    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


















    • 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













    0














    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.






    share|improve this answer


























      0














      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.






      share|improve this answer
























        0












        0








        0






        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 2 '11 at 5:06









        Rahul VyasRahul Vyas

        15.8k47163238




        15.8k47163238






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas