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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:54:00+00:00 2026-05-27T19:54:00+00:00

Can anyone explain me why we aren’t dereferencing a pointer now to an NSDate

  • 0

Can anyone explain me why we aren’t dereferencing a pointer “now” to an NSDate instance, when we actually want to get the data from this instance, not an address.

NSDate *now = [NSDate date];
NSLog(@"The date is %@", now);

The fact why i’m confused is that the previous example of NSLog usage in Aaron Hillegass “Objective-C Programming” book was:

NSDate *now = [NSDate date];
NSLog(@"The new date lives at %p", now);

This code is clear. We want address, we get it. But how do we get the actual date just by changing the specifier when we continue working with the pointer?

  • 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-27T19:54:01+00:00Added an answer on May 27, 2026 at 7:54 pm

    The “actual date” is a concept. The “data” is a series of bytes. They are not the same thing.

    If you were using good old fashioned C-style strings and printf, you would write this:

    char *name = "Zakatov";
    printf("My name is %s", name);
    

    This is because the printf function needs the address of the thing to work with it. You’re not passing “the actual data” but the address because it is way more efficient to pass the address around. Passing something to a function means copying its value to the stack area of memory, and it’s way faster to copy an address (32 or 64 bits) than to copy a whole string (several bytes, or maybe KB or MB).

    So in Objective-C we deal with pointers to objects all the time, because pointers are the easiest way to refer to them. The only thing that needs to dereference the pointers (look at the bytes) is the runtime system, for example when it is translating message selectors into function addresses to execute them. Your code just treats the pointer as a pointer, and passes it around without worrying about the precise layout of the data at the other end (the bytes).

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

Sidebar

Related Questions

Can anyone explain why these both compile happily : data A a b =
Can anyone explain the pros and cons to using Data.Text and Data.ByteString.Char8 data types?
Can anyone explain to me why I would want to use IList over List
Can anyone explain why I get the following errors when compiling the code shown
Can anyone explain why mysql_close() fails when called from a class destructor? mysql_error() reports
Can anyone explain to me why i get this error: Parse error: syntax error,
Can anyone explain why the third insert (labeled Query Data ) in the below
Can anyone explain why the Javascript from these slides fail? var ninja = {
Can anyone explain what this mod_rewrite rule is doing? I'm trying to comment the
Can anyone explain what advantages there are to using a tool like MSBuild (or

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.