• 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: Can you provide some code advice for a newbie please?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can you provide some code advice for a newbie please?


  • Subject: Re: Can you provide some code advice for a newbie please?
  • From: m <email@hidden>
  • Date: Tue, 12 Jul 2005 02:42:47 -0700


On Jul 12, 2005, at 1:48 AM, Paul Harvey wrote:

One last question. The line

if( ! [aTranslation characterAtIndex:0]==@".")

isn't working properly. In fact not at all!

Because you're comparing the character at 0, a unichar, to an NSString whose contents is a period.


Try:

if( ! [aTranslation substringWithRange:NSMakeRange(0,1)]==@".")

or

if( ! [aTranslation hasPrefix:@"."])

There are several other ways to skin this cat. Also search the archives for the proper way to detect whether an item at a given path is visible or not (I don't think checking for a "." prefix will catch all cases).

_murat _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Can you provide some code advice for a newbie please? (From: Paul Harvey <email@hidden>)

  • Prev by Date: Can you provide some code advice for a newbie please?
  • Next by Date: Re: [newbie] Cocoa UI and UTF-8
  • Previous by thread: Can you provide some code advice for a newbie please?
  • Next by thread: Cocoa API documentation
  • Index(es):
    • Date
    • Thread