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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:53:00+00:00 2026-05-22T14:53:00+00:00

The error i’mg etting is ‘Assignment makes pointer from integer without cast’. Here is

  • 0

The error i’mg etting is ‘Assignment makes pointer from integer without cast’. Here is my code:

typedef enum {
    UIIconTypeCustom = 0,
    UIIconTypeStandard,
} UIIconType;

.

-(void)addIconWithType:(UIIconType *)iconType {

...

}

And this is the line it has a problem with:

[iconView addIconWithType:UIIconTypeStandard];
  • 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-22T14:53:01+00:00Added an answer on May 22, 2026 at 2:53 pm

    Your method has a pointer as parameter:

    -(void)addIconWithType:(UIIconType *)iconType;
    // Takes a pointer to a UIIconType as argument
    

    and you are passing it an integer:

    [iconView addIconWithType:UIIconTypeStandard];
    // UIIconTypeStandard is not a pointer to a UIIconType
    

    Change your method definition to this:

    -(void)addIconWithType:(UIIconType)iconType;
    

    Also, don’t define your own enums, classes, or anything else with the prefix UI. That prefix is reserved by Apple and you will cause pointless headaches for yourself by using it. Use your initials or the initials of your company or of the project.

    The reason that almost all Objective-C methods have parameters with the asterisk is that when you are using an object, the object stays in one place in memory, and you just pass around a pointer to that object. That’s what MyClass * indicates — a pointer to an object of type MyClass. The pointer gives you the address of the object’s location in memory, so that you can avoid having to move the entire object from place to place when you want to use it. In this case, the thing that you want to pass to the method isn’t an object, but a simple integer, so you can just pass the integer directly.

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

Sidebar

Related Questions

Error: Type mismatch: cannot convert from Set<ConstraintViolation<capture#1-of ?>> to Set<ConstraintViolation<Class<?>>> My code: public class
Error: Unable to read data from the transport connection: A blocking operation was interrupted
ERROR: Microsoft JScript runtime error: Object doesn't support this property or method here is
Error can be seen here: http://djaffry.selfip.com:8080/ I want the index page to accept parameters,
Error is something like that : Can't load Items.aspx from 192.168.0.172 And a text
error: dereferencing pointer to incomplete type The problem line is gl->point[0] = (struct list
Error console: unterminated string literal $html='<li><div class=above>'+$question_number+ 'Question Title</div> The JQuery code is: $html='<li><div
Error: uncaught exception: [Exception... Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage] nsresult: 0x80040111 (NS_ERROR_NOT_AVAILABLE)
error msg: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. code: strSQL =
Error while reading Excel sheet from C#: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source

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.