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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:32:12+00:00 2026-05-15T08:32:12+00:00

I want to call a method which returns two values basically lets say my

  • 0

I want to call a method which returns two values

basically lets say my method is like the below (want to return 2 values)

NSString* myfunc
{
   NSString *myString = @"MYDATA";
   NSString *myString2 = @"MYDATA2";
   return myString;
   return myString2;        
}

So when i call it, i would use??

NSString* Value1 = [self myfunc:mystring];
NSString* Value2 = [self myfunc:mystring2];

I guess im doing something wrong with it, can anyone help me out?
Thanks

  • 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-05-15T08:32:13+00:00Added an answer on May 15, 2026 at 8:32 am

    You have a few options:

    • NSArray: Just return an array. Pretty simple.
    • Pointers: Pass in two pointers, and write to them instead of returning anything. Make sure to check for NULL!
    • Structure: Create a struct that has two fields, one for each thing you want to return, and return one of that struct.
    • Object: Same a structure, but create a full NSObject subclass.
    • NSDictionary: Similar to NSArray, but removes the need to use magic ordering of the values.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 501k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer foreach (var item in result) { var name = item.Name;… May 16, 2026 at 2:15 pm
  • Editorial Team
    Editorial Team added an answer string is not a C++ reserved word, but int is,… May 16, 2026 at 2:15 pm
  • Editorial Team
    Editorial Team added an answer The problem is the comma right before you insert the… May 16, 2026 at 2:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have two methods, one which counts the number of objects which are considered
I have the following C# helper class which retrieves a Json String from a
This might seem like a pretty detailed question about Easymock, but I'm having a
I have two classes: Action and MyAction . The latter is declared as: class
If you add a third signature for a method, do you make the second
I am making a sequence of Ajax calls using the Ext.Direct module. I want
I have the following Javascript function that should return an array of groups that
Recently I realized I needed to add an argument to the init method for
Is there a way to parse the argument values passed to a JavaScript function
Hey, I have a problem in Multithreading. To describe this, I have two threads.

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.