Re: passing argument 1 of 'stringWithFormat:' makes pointer from integer without a cast
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: "Ken Ferry" <email@hidden>
- Date: Mon, 21 Jul 2008 21:32:47 -0700
The parentheses are not correct in that position.
You're using the C comma operator
(http://www.eskimo.com/~scs/cclass/int/sx4db.html) and passing one
argument to stringWithFormat:, which is the count of the array. That
isn't a pointer.
-Ken
On Mon, Jul 21, 2008 at 9:23 PM, Michael Swan <email@hidden> 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
>
_______________________________________________
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