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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:50:50+00:00 2026-06-04T20:50:50+00:00

I am trying to pass a NSString to another view. In my first view

  • 0

I am trying to pass a NSString to another view.

In my first view (is a map view) my code is:

FirstView.m file:

import “FlipsideViewController.h”

-(IBAction) displayDetails:(id) sender{

MyLocation *ann = [_mapView.selectedAnnotations objectAtIndex:([_mapView.selectedAnnotations count]-1)];

FlipsideViewController *flipsideViewController;
flipsideViewController=  [[FlipsideViewController alloc]init];
flipsideViewController.details =ann.name;
NSLog(@"ann.name:%@", ann.name);
NSLog(@"details:%@", flipsideViewController.details);

FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"details" bundle:nil];
    controller.delegate = self;     
  controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];
    [controller release]; 

}

and the NSlog print the correct string. But when I try to pass that string to my SecondViewController string called details:

In my FlipsideViewController.h is defined:

NSString *details;

@property (nonatomic, strong) NSString *details;

While in the FlipsideViewController.m

@synthesize details; //and whenever I put the log, it prints the null value

value: NSLog(@”**************detalli %@”,detalli);

Where is my fault?

  • 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-04T20:50:51+00:00Added an answer on June 4, 2026 at 8:50 pm

    in the secondViewController add a property, a retained property of type NSString
    For adding properties please read the following

    http://cocoacast.com/?q=node/103

    Please edit this section

    FlipsideViewController *flipsideViewController;
    flipsideViewController=  [[FlipsideViewController alloc]init];
    flipsideViewController.details =ann.name;
    NSLog(@"ann.name:%@", ann.name);
    NSLog(@"details:%@", flipsideViewController.details);
    
    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"details" bundle:nil];
        controller.delegate = self;     
      controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:controller animated:YES];
        [controller release]; 
    

    to

    FlipsideViewController *flipsideViewController;
    flipsideViewController=  [[FlipsideViewController alloc]init];
    flipsideViewController.details =ann.name;
    NSLog(@"ann.name:%@", ann.name);
    NSLog(@"details:%@", flipsideViewController.details);
    
    flipsideViewController.delegate = self;     
    flipsideViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:flipsideViewController animated:YES];
    [flipsideViewController release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass a variadic argument (NSString *) from one method to another
I'm trying to create an XML string and pass it to another method where
I'm trying to pass an NSString by reference but it doesn't work. This is
I'm trying to pass 3 objects to another VC but they are showing up
I am trying to pass Array from one class to another I used detailViewController.nameArray
I'm trying to pass an NSString address object to a UILabel text, but I
I am trying to pass a uitextfield string from a view controller over to
I'm trying to pass data around objects using singleton pattern. Here is my code
Im trying to pass to another xib some data of NSMutableArray. I created a
I am trying to pass a String from an IBAction in my DetailsViewController to

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.