• 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: compiler warning when attempting to save hex value in char in reusing it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiler warning when attempting to save hex value in char in reusing it


  • Subject: Re: compiler warning when attempting to save hex value in char in reusing it
  • From: Charles Steinman <email@hidden>
  • Date: Tue, 4 Sep 2007 17:19:54 -0700 (PDT)

--- Sebastian Pape <email@hidden> wrote:

> I've been working with XCode and Cocoa for a few
> days now and got a little
> stuck with a problem:
>  char seq =  0x02;
>  NSMutableData *sequence = [[NSMutableData alloc]
> init];
>  [sequence appendBytes:seq length: 1];
>
>
> I always get a warning from the compiler telling me:
>  warning: passing
> argument 1 of 'appendBytes:length:' makes pointer
> from integer without a
> cast

It's telling you precisely what's wrong: The method
expects a pointer, but you're giving it a character
value. If you want to append the contents of seq to
the data, it should be [sequence appendBytes:&seq
length:1].

Cheers,
Chuck



____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
_______________________________________________

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: 
 >compiler warning when attempting to save hex value in char in reusing it (From: "Sebastian Pape" <email@hidden>)

  • Prev by Date: Re: compiler warning when attempting to save hex value in char in reusing it
  • Next by Date: Re: How to de-register value observers
  • Previous by thread: Re: compiler warning when attempting to save hex value in char in reusing it
  • Next by thread: Attributed Strings in Distributed Objects
  • Index(es):
    • Date
    • Thread