Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ct2k7

macrumors G3
Original poster
Aug 29, 2008
8,383
3,439
London
Xcode is the IDE. I presume you mean "how do I code this in Cocoa?"

Look at the NSString documentation. The methods you want are hasPrefix: and length. The JavaScript code on the stackoverflow.com link could almost be ported line by line to Cocoa.
 
Xcode is the IDE. I presume you mean "how do I code this in Cocoa?"

Look at the NSString documentation. The methods you want are hasPrefix: and length. The JavaScript code on the stackoverflow.com link could almost be ported line by line to Cocoa.

I've tried and I'm getting absolutely nowhere with it.

Should I use textField:shouldChangeCharactersInRange:replacementString:?

I'm still going nowhere with that :/
 
This is pretty basic Cocoa programming stuff... if you're confused here, I suggest picking up a book and start from the beginning. There are threads here that discuss iPhone specific books.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.