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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:53:05+00:00 2026-06-08T06:53:05+00:00

I have a tabbed views where I need to select various options from different

  • 0

I have a tabbed views where I need to select various options from different tabbed views which should be appended in the same string. For this I want to use a NSMutableString.

After all the options are selected and string is formed as required. I want to access this NSMutableString in the next view which is not tabbed. I think for this I need to declare the NSMutableString as a global variable?

Can someone please help me with this. I am new to objective-c and xcode. Thank you. Any help is much appreciated!

  • 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-08T06:53:06+00:00Added an answer on June 8, 2026 at 6:53 am

    Another option would be to have a singleton object, especially useful if you have more than just one variable you want shared.

    Here’s a good post about doing singletons right: http://lukeredpath.co.uk/blog/a-note-on-objective-c-singletons.html

    Basically you’d have write a very simple class something like:

    State.h:

    @interface State : NSObject
    
    @property (atomic, strong) NSMutableString *mystring;
    + (id)sharedInstance;
    
    @end
    

    State.m:

    #import "State.h"
    @implementation State
    
    @synthesize mystring;
    
    + (id)sharedInstance
    {
      static dispatch_once_t pred = 0;
      __strong static id _sharedObject = nil;
      dispatch_once(&pred, ^{
        _sharedObject = [[self alloc] init]; // or some other init method
      });
      return _sharedObject;
    }
    @end
    

    and then whenever you need it you could do:

    import "State.h"
    
    [State sharedInstance].mystring
    

    Even simpler you can use singleton macro from here: https://gist.github.com/1057420#gistcomment-63896

    I’ve personally found this pattern to be extremely useful.

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

Sidebar

Related Questions

I have this db storing sensors acquisition data, Acquisitions (acq) come from different Control
I have tabbed iOS application. I need to know which tab is active and
I have a coding style question which probably should be asked of a senior
I have this code that i did on Xcode 4.2 in a tabbed application
I'm working on a storyboard app in which one of it's tabbed views is
I have a tabbed form with 6 fields. 3 fields are active on each
Basically I have a tabbed Panel I'm creating. When the user click on a
I have the following problem. I have a tabbed application implemented using a ViewPager.
I am new to C#, Windows Forms, and datagridviews. I have a tabbed form:
I have designed a tabbed page. I'm able to load forms in the tabs

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.