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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:52:13+00:00 2026-05-18T01:52:13+00:00

I’m new to iPhone development, and am sort-of getting there with pointers in Objective-C.

  • 0

I’m new to iPhone development, and am sort-of getting there with pointers in Objective-C. Can anyone briefly explain pointers to me? I know that some native C types don’t need pointers (i.e. are weakly typed), such as int.

Also, what’s the difference between:

NSDate* theDate = [NSDate date];

and:

NSDate *theDate = [NSDate date];

?

Thanks again StackOverflow!

  • 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-18T01:52:14+00:00Added an answer on May 18, 2026 at 1:52 am

    There’s no difference between those two things. The asterisk denotes a pointer but may have whatever whitespace you like either side of it. E.g. the following is also valid:

    NSDate * theDate = [NSDate date];
    

    The creators of Objective-C chose to add objects to C by keeping them all on the heap (ie, they’re things you explicitly create and destroy — there’s no such thing as a local object in Objective-C) and referring to them via pointers. Pointers are just memory addresses. So ‘NSDate *’ isn’t an NSDate, it’s just a record of where in memory an NSDate object lives. Exactly like the difference between a street address and a house.

    Primitive operations (like addition, multiplication, etc) work only on C primitive types, like int, short, float, etc. Technically the pointers you keep to Objective-C objects are primitive types, because the thing you actually have is the address not the object. But they’re not generally very useful.

    You operate on objects only by sending messages to them. The square bracket syntax means ‘send this message to this object’. Which, when you’re just starting, is sufficiently like a function call to just think of it as that. There’s a distinction in that some things C does at compile time, Objective-C does at runtime. But you can just trust that they’re being done for now.

    Objective-C is relatively typeless — you declare pointers as being of a particular type but the operations you perform on them (ie, sending messages) act in exactly the same way irrespective of the type. That’s why the ‘id’ type (which means any object) can exist. Objective-C is weakly typed in the sense that a variable of type id can have a pointer to any object assigned to it.

    In practice, all objects descend from NSObject so it’s often more useful to use NSObject * and an explicit cast when type hopping. That means you can use the things NSObject adds without compiler warnings, including Objective-C’s reference counted memory stuff, the things for finding out whether an object can perform a particular message and so on.

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

Sidebar

Related Questions

No related questions found

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.