• 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: Question about getBytes:length:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about getBytes:length:


  • Subject: Re: Question about getBytes:length:
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Tue, 24 Nov 2015 04:03:18 +0000

Thank you very much!

On Mon, Nov 23, 2015 at 11:00 PM Lee Ann Rucker <email@hidden> wrote:

>  [UUID1.data getBytes:b1 length:16]
> since that's the size of your buffer. Doc says "The number of bytes copied
> is the smaller of the length parameter and the length of the data
> encapsulated in the object."
> ________________________________________
> From: cocoa-dev-bounces+lrucker=email@hidden
> [cocoa-dev-bounces+lrucker=email@hidden] on behalf of Eric
> E. Dolecki [email@hidden]
> Sent: Monday, November 23, 2015 7:55 PM
> To: cocoa-dev
> Subject: Question about getBytes:length:
>
> I have a bit of old code someone else wrote. I get warnings since getBytes
> is deprecated since iOS 8. I don't know enough about this but would like to
> use the *getBytes:length:* to turn them off. How would I get a length from
> something like this? This is part of code I've bridged into a Swift
> project.
>
> Thanks,
> Eric
>
> -(int) compareCBUUIDToInt:(CBUUID *)UUID1 UUID2:(UInt16)UUID2
> {
>     char b1[16];
>  *   [UUID1.data getBytes:b1]; //<---*
>     UInt16 b2 = [self swap:UUID2];
>     if (memcmp(b1, (char *)&b2, 2) == 0)
>         return 1;
>     else
>         return 0;
> }
> _______________________________________________
>
> 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: 
 >Question about getBytes:length: (From: "Eric E. Dolecki" <email@hidden>)
 >RE: Question about getBytes:length: (From: Lee Ann Rucker <email@hidden>)

  • Prev by Date: RE: Question about getBytes:length:
  • Next by Date: Re: Question about getBytes:length:
  • Previous by thread: RE: Question about getBytes:length:
  • Next by thread: Re: Question about getBytes:length:
  • Index(es):
    • Date
    • Thread