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

  • Home
  • SEARCH
  • 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 8455861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:23:48+00:00 2026-06-10T12:23:48+00:00

The NSMutableArray detailsDataSource and int detailIndex is passed on to next View Controller from

  • 0

The NSMutableArray detailsDataSource and int detailIndex is passed on to next View Controller from
MainDetailViewController.m:

#import "UsersDetailViewController.h"
...
- (void)swipeDetectedUp:(UISwipeGestureRecognizer *)sender
{
    UsersDetailViewController *usersController = [[self storyboard] instantiateViewControllerWithIdentifier:@"UsersController"];
    [self.navigationController pushViewController:usersController animated:NO];

    usersController.usersDataSource = [[NSMutableArray alloc] initWithArray:detailsDataSource];
    usersController.userDetailIndex = detailIndex;
}

Swipe through the index in UserDetailViewController.m:

- (void)swipeDetectedRight:(UISwipeGestureRecognizer *)sender
{
if (userDetailIndex != 0)
    userDetailIndex--;  
}

When swipeDetectedDown to pop back, MainDataViewController needs to know which object at index to display:

- (void)swipeDetectedDown:(UISwipeGestureRecognizer *)sender
{
//jump to correct object at index, same as current object at index in this view
[self.navigationController popViewControllerAnimated:NO];
}

Code suggestions?

  • 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-10T12:23:49+00:00Added an answer on June 10, 2026 at 12:23 pm

    Use NSNotificationCenter to send an object back to the MainDataViewController…

    Example:

    In UsersDetailViewController populate an NSDictionary with a key=>value pair then send it over to where you want it to go.

    NSArray *key = [NSArray arrayWithObject:@"myIndex"];
    NSArray *object = [NSArray arrayWithObject:detailIndex];  
    NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:object forKeys:key];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"MainDataViewController" object:self userInfo:dictionary];
    

    Note: You need to setup an identifier on MainDataViewController called MainDataViewController or whatever you want to call it. Using the VC name keeps it simpler.

    Then on MainDataViewController do this in the viewDidLoad() method.

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"MainDataViewController" object:nil];
    

    And then receive the notification by using the following method:

    - (void)receiveNotification:(NSNotification *) notification
    {    
        if([[notification name] isEqualToString:@"MainDataViewController"])
        {       
            NSDictionary *dictionary = [NSDictionary dictionaryWithDictionary:[notification userInfo]];
    
            if([dictionary valueForKey:@"myIndex"]) 
            {
                // do whatever you need to do with the passed object here. In your case grab the detailIndex and use it for something...
            }             
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NSMutableArray *tempArr = [[NSMutableArray alloc] init]; if (self.subCategory) { for (int i = 0;
NSMutableArray *tmpMutArr = [NSMutableArray arrayWithArray:allObjectsArray]; NSLog(@The content of array is%@,tmpMutArr); int index; for (int
My NsmutableArray having value like myArray = 1,2,3,4,5....10; these are comes from server. i
identifierListController.nameArray = [[NSMutableArray alloc] initWithArray:nameArrayT copyItems:YES]; namearray is array of view controllers. I am
I have an NSMutableArray that is loaded into a table view. The data in
I have a NSMutableArray consisting of several elements. From this array I want to
-(NSMutableArray*) fetchMakeNamesYear1:(int) year1 Year2:(int) year2 compileStaement: (sqlite3_stmt*)compiledStatement { NSMutableArray *makeNames=[NSMutableArray array]; NSString *selectQuery=[NSString stringWithFormat:@SELECT
I have a NSMutableArray containing 7 internet URLs from which I need to grab
NSMutableArray *insideArray = [[NSMutableArray alloc] init]; NSMutableArray *outsideArray = [[NSMutableArray alloc] init]; [insideArray addObject:@Hello
NSMutableArray *output = [[NSMutableArray alloc]init]; or NSArray *output = [[NSMutableArray alloc]init]; I can set

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.