• 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: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast


  • Subject: Re: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
  • From: Aron Nopanen <email@hidden>
  • Date: Tue, 22 Jul 2008 16:30:08 +1200

I think the parens around the argument to stringWithFormat: are causing the compiler to interpret the comma as a C comma operator, which means the result of the first expression (your format string) is ignored, and the result of the second expression ([array count]) is treated as the result of the parenthesized expression.

In other words, remove the parens.

On 22/07/2008, at 4:23 PM, Michael Swan wrote:

So I have done the standard Google search and clean all targets but neither has helped. I have the following two lines of code:

NSLog(@"array count = %i",[array count]); // This works just fine
NSString *string = [NSString stringWithFormat:(@"array count = %i", [array count])]; // This gives the warning "passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast"



Has something happened to NSString to mess it up or am I just missing something really obvious here?


Thanks,
Mike Swan

"Change itself is not painful it is resistance to change that causes pain."



_______________________________________________

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast (From: Michael Swan <email@hidden>)

  • Prev by Date: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
  • Next by Date: Re: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
  • Previous by thread: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
  • Next by thread: Re: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
  • Index(es):
    • Date
    • Thread