• 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: Checking For Keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking For Keys


  • Subject: Re: Checking For Keys
  • From: Allan Odgaard <email@hidden>
  • Date: Mon, 21 Jun 2004 04:04:35 +0200

On 20. Jun 2004, at 18:50, Oliver Cameron wrote:

characters = [theEvent characters];
unicodeChar = [characters characterAtIndex:0];

I have seen this in a number of code snippets, and try to correct it each time ;)

This is WRONG! The 'characters' method may return an empty string, and then the 'characterAtIndex:' method will throw an exception! You may want to use 'hasPrefix:' instead.

[...] What I am looking to do is only insert the "" only if it is inside a "<" and not outside the ">".

Any ideas?

Other than retrieve the text from your superclass and search through it? Unfortunately none from me...
_______________________________________________
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.


References: 
 >Checking For Keys (From: Oliver Cameron <email@hidden>)

  • Prev by Date: Re: NSButton behavior
  • Next by Date: Re: Number Formatting
  • Previous by thread: Checking For Keys
  • Next by thread: Custom buttons
  • Index(es):
    • Date
    • Thread