Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:14:04+00:00 2026-06-14T05:14:04+00:00

I am using this script for slide menu SASlideMenu and I am trying to

  • 0

I am using this script for slide menu “SASlideMenu” and I am trying to select the first item by default, but with no success. Does anybody know how to do it?

I tried this:

(void) viewDidLoad{
    [super viewDidLoad];

    ...

    self.tableView.delegate = self;
    NSString *CellIdentifier = @"homeCell";
    UITableViewCell *homeCell = [self.tableViewdequeueReusableCellWithIdentifier:CellIdentifier]; 
    [homeCell setSelected:YES];

}

UPDATE (improved explanation)

I am doing this in “SASlideMenuViewController.m”

UPDATE 2

Further to main question I would like to ask when user enters applicationWillEnterForeground how to select then first cell and switch to home page?
P.S. I dont want to open another question for that, because it could be treated like a “duplicate”.

UPDATE 3
I don’t know how to switch to home page when user is on another view. For example we switch user to home page when he came back to app(foreground), but this doesn’t work in next situation; in SASlideMenu I have list of categories and when I go to one of this categories and then exit from app and back again into app, it switch me to home page and that’s ok. But when I click on one of categories in SASlideMenu and then click inside of category view on one of articles and exit app and enter again then it does not switch me to home page and I don’t know why. It’s navigation based app.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:14:06+00:00Added an answer on June 14, 2026 at 5:14 am

    Question 1: To select the first item by default on launch of app

    Assuming that you are using the SASlideMenu code mentioned in the question. In your ExampleMenuViewController class you need to add the following,

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
    
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
        if (indexPath) {
            [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
        }
    }
    

    __________________________________________________________________________________

    Question 2: To select the first item by default and to set home screen in applicationWillEnterForeground

    Add the following method declaration in your ExampleMenuViewController.h file,

    @interface ExampleMenuViewController :SASlideMenuViewController<SASlideMenuDataSource>
    
    - (void)selectFirstRowAndSetHomePage;
    
    @end
    

    Add the following method in your ExampleMenuViewController.m file,

    - (void)selectFirstRowAndSetHomePage {
    
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
        if (indexPath) {
            [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
        }
    
        NSString *identifier= [self.slideMenuDataSource initialSegueId];
        if (identifier) {
            [self performSegueWithIdentifier:identifier sender:self];
        }
    }
    

    Implement the following in your SASlideMenuAppDelegate.h class,

    #import "ExampleMenuViewController.h"
    

    And,

    - (void)applicationWillEnterForeground:(UIApplication *)application {
    
        ExampleMenuViewController *exampleMenuViewController = (ExampleMenuViewController *)self.window.rootViewController;
        [exampleMenuViewController selectFirstRowAndSetHomePage];
    }
    

    That should help.

    __________________________________________________________________________________

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hihi, I am trying to create a slide down menu using DIV, but hit
I'm trying to implement Orbit Slider in my homepage using this code: <script type=text/javascript
in my site i want to set default page to open, using this script
I am using this jQuery menu script: (function($) { $.fn.blowfish = function() { //
I've been using this script for a long time and it works perfectly in
I compress my files using this script import pylzma, struct i = open(path+fileName,'rb') o
I'm using this script below for loading a hidden div, inside another: $(document).ready(function(){ $(function()
I'm using this script which works fine for a single lightbox popup window. I
I have a file hosting site that's using this script MFHS . I want
Hay, i'm using this script function preloader(images){ var i = 0; imageObj = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.