• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: warning: assignment makes integer from pointer without a cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: assignment makes integer from pointer without a cast


  • Subject: Re: warning: assignment makes integer from pointer without a cast
  • From: Tony Becker <email@hidden>
  • Date: Tue, 16 Oct 2007 13:08:46 -0400

Put the prototype in a "private" declaration, at the top of the class file, like:

@interface YourClass (PRIVATE)
-(BOOL) methodThatReturnsABool;
@end

That will fix your compile errors without exposing the method outside the class

On Oct 16, 2007, at 12:36 PM, Ryan Poling wrote:

I'm getting the following warning and I can't figure out how to suppress it, or whether or not I really need to worry about it.

	warning: assignment makes integer from pointer without a cast

The warning is on the following line of code which calls a *private* method (meaning that I haven't declared a prototype in the .h file and don't want to). I imagine the compiler thinks the method will return an id and this is why I'm getting the error, but do I need to worry about this? I tried creating a category in the same .m file and declaring the prototype there, but I still get the warning. Declaring the prototype in the .h file *does* make the warning disappear, but I'd rather not declare it there because I don't want consumers of the interface to call it.

	BOOL myBoolean = [self methodThatReturnsABool];

Any suggestions for how to correctly deal with this situation but still leave the method private? I read online about a similar problem when calling a delegate method and expecting a return of type BOOL, but I'm not sure that solution applies here.

Thanks!

-Ryan

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >warning: assignment makes integer from pointer without a cast (From: Ryan Poling <email@hidden>)

  • Prev by Date: Re: warning: assignment makes integer from pointer without a cast
  • Next by Date: Re: Kludges when binding to 'value' of Menu Items
  • Previous by thread: Re: warning: assignment makes integer from pointer without a cast
  • Next by thread: Re: warning: assignment makes integer from pointer without a cast
  • Index(es):
    • Date
    • Thread