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 7895497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:39:28+00:00 2026-06-03T07:39:28+00:00

I am trying to send a nsmutablearray from one navigational embedded view controller to

  • 0

I am trying to send a nsmutablearray from one navigational embedded view controller to another viewcontroller after this method

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{NSLog(@"tapped %@ %d",view.annotation.title,[res count]);
    gpDetailViewController *gpDetailView = [[gpDetailViewController alloc] init];
    gpDetailView.title = @"Details";
    gpDetailView.detailArray = res;
         [self.navigationController pushViewController:gpDetailView animated:YES];



} 

is executed.
Here is the interface and implementation files for gpDetailViewController.

//
//  gpDetailViewController.h
//  livewell prototype
//
//  Created by MyOxygen Mobile on 02/05/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface gpDetailViewController : UIViewController{
    NSMutableArray *detailArray;
}
@property (nonatomic,retain) NSMutableArray *detailArray;


@end

and gpDetailViewController.m

//
//  gpDetailViewController.m
//  livewell prototype
//
//  Created by MyOxygen Mobile on 02/05/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "gpDetailViewController.h"

@interface gpDetailViewController ()

@end

@implementation gpDetailViewController
@synthesize detailArray;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    detailArray = [[NSMutableArray alloc]init];

    NSLog(@"%@",[self.detailArray count]);
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

I am getting a null value when i am trying to print the array elements size.
What could be the reason?

  • 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-03T07:39:29+00:00Added an answer on June 3, 2026 at 7:39 am

    Instead of

    NSLog(@"%@",[self.detailArray count]);
    

    try this

    NSLog(@"%d",[self.detailArray count]);
    

    count is an integer, not a class

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

Sidebar

Related Questions

im trying to send two bundles at once from one activity to another and
I am trying to send an Array from one player to another. I create
am trying to send a variable from one activity to another i have set
in my iPhone App i am trying to send data from one device to
Im trying to send a mail from a asp.net script, but im getting this
im trying to send a parameter from my touchesEnded handler like so... - (void)touchesEnded:(NSSet
Im trying to send an object from client to server and one of the
I'm trying to send information from a form and a hidden email variable (from
I am trying to send email using Exchange 2007 from a console app using
I am trying to send an email from a Ruby program. The smtp server

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.