• 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: very simple NSRange q
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: very simple NSRange q


  • Subject: Re: very simple NSRange q
  • From: Andrew Pinski <email@hidden>
  • Date: Mon, 11 Aug 2003 23:03:45 -0400

On Monday, Aug 11, 2003, at 10:13 US/Eastern, Alastair J.Houghton wrote:
Use NSMakeRange(). The second one doesn't work because it isn't legal to write an initialiser (which is what {start, length} is) in code, only in a declaration. You *can* work around this with GCC by writing (NSRange){start, length}, but it's a non-standard extension. Better to use the helpfully provided NSMakeRange() function. BTW, there are similar functions for many of the other struct types.
(NSRange){start, length} is not a non standard extension as it is part of ISO C99.

Thanks,
Andrew Pinski
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: very simple NSRange q
      • From: "Alastair J.Houghton" <email@hidden>
References: 
 >Re: very simple NSRange q (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Questions about retain count / NSOpenPanel behaviour
  • Next by Date: Re: Dropping files and folders on the application icon?
  • Previous by thread: Re: very simple NSRange q
  • Next by thread: Re: very simple NSRange q
  • Index(es):
    • Date
    • Thread