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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:44:10+00:00 2026-05-15T21:44:10+00:00

SomeObject *obj = [[SomeObject alloc] init] [obj someMethod] obj.someProperty Both [] and . automatically

  • 0
SomeObject *obj = [[SomeObject alloc] init]
[obj someMethod]
obj.someProperty

Both [] and . automatically dereference the pointer, correct? So anytime you are working with objects, you will always use pointers to reference those objects.

Will a variable ever be declared in Objective-C that does not have a pointer type?

  • 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-15T21:44:10+00:00Added an answer on May 15, 2026 at 9:44 pm

    With one exception, all objects in Objective-C live exclusively on the heap, which means you will always be dealing with object references.

    The one exception is blocks, which can be created on the stack and then subsequently moved to the heap using Block_copy(). For example:

    dispatch_block_t myBlock = ^{
      NSLog(@"This is a block that lives on the stack");
    };
    

    And due to how they’re implemented, blocks can be treated as objects (ie, you can use them anywhere you could use an id).

    Of course, any non-Objective-C objects can be created on the stack. So if you’re using Objective-C++, then you can create C++ objects on the stack (like normal), which means you’ll be dealing with the object itself and not a reference. Also, any primitive can be created on the stack (int, char*, a structure, etc).

    So in a nutshell, if you’re dealing with objects, then 99.999% of the time you’ll be dealing with object references, and never the object itself. Anything else is entirely up to you.

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

Sidebar

Related Questions

If I have something like this: SomeObject *obj = [[SomeObject alloc] init]; obj.someIvar =
I've seen a lot of ObjC code which do: obj = [[SomeObject alloc] init];
id idPointer = [[SomeObject alloc] init]; NSObject *nsPointer = [[SomeObject alloc] init]; How do
I have the following object: Someobject *Object = [[Someobject alloc] init]; void (^Block)() =
I'm doing this query: SomeObject.objects.annotate(something=Avg('something')).order_by(something).all() I normally have an aggregate field in my model
What's the difference between doing this: public class SomeClass { SomeObject obj = new
In the C++ code below, am I guaranteed that the ~obj() destructor will be
A coworker routinely writes something like this: ::someObject->someMethod(anAttribute, anotherAttribute); someObject is a global variable.
There are two code snippets: someObject.getBla1().getBla2().performBlah(); And the second one: bla1=someObject.getBla1(); bla2=bla1.getBla2(); bla2.performBlah(); I
Let's have an example: using (var someObject = new SomeObject()) { var someOtherObject =

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.