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 490k
  • Answers 490k
  • 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 First of all, it's a really bad idea to use… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer If you are not dead set on using a listbox,… May 16, 2026 at 9:17 am
  • Editorial Team
    Editorial Team added an answer killproc will terminate programs in the process list which match… May 16, 2026 at 9:17 am

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
I got a rather big class library that contains a lot of code. I
Being pretty unfamiliar with design patterns and architecture, I'm having trouble explaining to others
I have a framework that allows users to do queries to a specific datasource
I read from the jQuery website, that get() loads data from the server using
I have an abstract class defined as follows: abstract class Abstract Parent extends Zend_Db_Table_Abstract

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.