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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:52:01+00:00 2026-06-03T03:52:01+00:00

From what I understand (and please correct me if I’m wrong): int x, count

  • 0

From what I understand (and please correct me if I’m wrong):

int x, count = 10;
int *hello;
hello = &count;
x = *hello;

Here the variables x and count are declared to be of type integer. Additionally, the variable count is assigned the value of 10.

hello is a pointer to type integer. hello is then assigned the address of count.
In order to access the value of count, hello must have an asterisk in front of it, ie, *hello.

So, x is assigned the value of whatever is in count and in this case, 10.

However…

Fraction *myFraction = [[Fraction alloc] init];
[myFraction someMethod];

Here, if I understand correctly, myFraction is a pointer to an instance of Fraction class.

myFraction is pointing to (or rather assigned the address of) an object which has been assigned memory and initialised.

Surely, in order to access the object that myFraction points to, I ought to write:

 [*myFraction someMethod];

Given the way in which x accessed the value of count, surely in order to access the object, one ought to write this and not:

[myFraction someMethod]; 

In addition, if I have

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *str = @"Programming can be a headache";
NSLog (@"%@\n", str);

Why is str being treated as an object above? Or is str an object and in which case, why would I want to make it point to an instance of NSString class? Surely, I ought to be able to just assign an object to str?

  • 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-03T03:52:03+00:00Added an answer on June 3, 2026 at 3:52 am

    All the usage of objects in objective c is done through object references, e.g. pointers.

    • The Objective C syntax lets you treat objects without dereferencing them, this is different than C / C++ for that matter.
    • str is an object reference of type NSString (as myFraction) and @"Programming can be a headache" is an object reference of type NSString as well, so you can assign it to str.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From what I understand, each HTTP request uses its own TCP connection (please correct
(Please correct me if i am wrong) I understand that when you run a
Here's how I understand asp.net compilation. Please correct any errors in my understanding. If
Can someone please explain how to understand a logcat from an android force close.
I found that Maven implies specific directory layout. But I don't understand from here:
I've read and I believe I understand what C#'s using statement does (please correct
Please correct me if I am wrong. I am asking this question to clarify
As far as I can understand from the java.lang.Thread docs, and from other questions
I am using DBus in a project. I understand from DBus specification that for
From what I understand, the parent attribute of a db.Model (typically defined/passed in the

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.