how to scroll NSScrollView to the bottom?

Discussion in 'Mac Programming' started by mkristain, Sep 24, 2011.

  1. mkristain macrumors regular

    Joined:
    Aug 18, 2011
    #1
    Hi all,

    i want to display currently inserting image in IKImageBrowserView so please tell me how can i scroll the NSScrollView to the bottom.

    thanks.
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Try sending scrollIndexToVisibile: to your IKImageBrowserView object with the index of the newly inserted image.
     
  3. mkristain thread starter macrumors regular

    Joined:
    Aug 18, 2011
    #3
    yes i already try this but its not working.

    Code:
    [imageBrowser scrollIndexToVisible:[images count]];
    
    even after using this when i move down the vertical scroll bar to down its automatically move to up and show first visible item.
     
  4. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    [image count] will not be a valid index. It's not the last index, but one off the last index.

    Try
    Code:
    [imageBrowser scrollIndexToVisible:[images count] - 1];
    
     
  5. mkristain thread starter macrumors regular

    Joined:
    Aug 18, 2011

Share This Page