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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:40:46+00:00 2026-06-08T22:40:46+00:00

I am writing code for the iPad. I have a point structure that I

  • 0

I am writing code for the iPad. I have a point structure that I define:

typedef struct __Point32_t
{
    int32_t x;
    int32_t y;
}Point32_t;

Here is my code to receive a structure back from an objective-C method:

Point32_t ModalityPan = [self ReadPoint];

Here is the method:

-(Point32_t)ReadPoint
{
    Point32_t P;
    P.x = [self ReadInt];
    P.y = [self ReadInt];
    return P;
}

The assignment of the return value to the structure creates an error at compile time. The error claims I have an invalid initializer. If I change the assignment to:

Point32_t * ModalityPan = [self ReadPoint];

the error goes away. So I am left wondering what is actually being passed back in Objective-C. I have searched through many posts, some here at SO, and I am under the impression that structures are passed and returned to and from methods in Obj-C without needing to reference the structure (e.g., I am allowed to pass by value).

Can anyone explain what is happening under the hood here? What is coming back, a reference or a structure? and if a structure, why do i need to specify a reference as the type of variable being assigned to?

  • 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-08T22:40:47+00:00Added an answer on June 8, 2026 at 10:40 pm

    Well it turns out that the compiler was warning me in a very indirect way that my method was not defined in the @interface and the implementation for the method was below my using it. So the compiler appears to not have been able to figure out what the return type was. It compiles correctly now.

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

Sidebar

Related Questions

While writing code in a file that would comprise of PHP, HTML, CSS &
I am writing code to clone object but have no cue from Hobo documentation.
I'm writing code in PHP that requires including a config.php file depending on the
I am writing an iPad app that downloads a rather large .csv file and
When writing code in JScript, as I am wont to do as I have
I am writing code that involved a for loop that makes calculations at each
I am writing an iPad app that presents user documents similar to the way
When writing code in Python, how can you write something next to it that
I'm writing code that uses sched_setaffinity, which requires kernel 2.5.8 or later. I've been
I was recently asked if I could code a simple IPhone/IPad app that: Checks

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.