On Wed, Aug 6, 2008 at 6:23 PM, Phil Faber <[EMAIL PROTECTED]> wrote: > NSLog(@"Character %i of %@ is %@",i,pass1,[pass1 substringWithRange:1,2]);
You need to pass an NSRange struct to -[NSString substringWithRange:]. You can make one using the NSMakeRange() function. If you didn't know that function existed, you could always have just created one manually: NSRange range; range.location = 1; range.length = 1; Also, be careful with NSString character-related functions, because you get into very thorny issues with respect to "byte" versus "character" versus "unichar" versus "Unicode code point". String slicing is not for the faint of heart (or for those unfamiliar with surrogate pairs). --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]