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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:27:38+00:00 2026-05-22T11:27:38+00:00

I am learning how to create iPhone apps and I have seen that most

  • 0

I am learning how to create iPhone apps and I have seen that most of the variables we create store memory addresses (pointers) instead than holding the actual value or object. I also have found out that every time you declare a variable with the pointer char (*) you know that the variable is going to hold the address and whenever you don’t use the (*) mark to declare a variable you know that it will hold the value instead than the memory location. But I don’t know when to us which. for example I have:

CGFloat someVar = [image1 alpha];  // This variable does not require *
                                   // image 1 is a: IBOutlet UIImageView

and in this other case I have to use a pointer:

UIViewController *someOtherVar = [[UIViewController alloc] init];  // this type of var requires *

It will be nice if I can know when can I use each instead of trying each until project compiles.

  • 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-22T11:27:38+00:00Added an answer on May 22, 2026 at 11:27 am

    The function and method signatures in the headers and documentation will indicate what the type is.

    For example, here is how the alpha property is declared for UIView:

    @property(nonatomic) CGFloat alpha;
    

    There is no * anywhere, so you know it returns CGFloat and not CGFloat*.

    In contrast, the backgroundColor property is declared like this:

    @property(nonatomic, copy) UIColor *backgroundColor;
    

    so you know it will return UIColor* (a pointer).

    Some things are declared with a type of id, which is always going to be a pointer to an object.

    In general, Objective-C objects (types declared with @interface) will always be referenced as pointers, while primitive C types and structs will often (but not always) be passed and returned by value.

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

Sidebar

Related Questions

I have a simple iPhone app that Im learning and I want to have
Possible Duplicate: How to Start learning to create iphone apps I only know basic
I learning Perl and I want to create a simple application that gets all
I am learning Cocoa and trying to create an application for Mac that displays
I just start learning WPF, is that possible I can create an IE toolbar
I've only just started learning to build iPhone apps using xcode. I'm slowly getting
First some background: The company I work for have decided to create an iPhone
I'm an iPhone/Objective-C newbie with an extensive Java background. I'm learning more about memory
I am learning how to create plugin and have problem in how to create
I have been learning how to create dynamic images and dynamic stylesheets using ASP.NET

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.