Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 9, 2012, 08:23 PM   #1
Starfox
macrumors regular
 
Join Date: Apr 2011
Replacing a substring in an NSString

I've been trying to replace a substring of an NSString and it has been driving me crazy - the problem is the edge case where characters in the string take more than one UTF-16 codepoints, like Emoji. characterAtIndex: is kind of useless in this case and my best solution was going character by character getting the ranges for UTF-chars but my code seems to crash with out-of-range exceptions. Could anyone lend me a second pair of eyes? Code is at http://pastebin.com/kazBx6Qt
Starfox is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
C Function from NSString? ArtOfWarfare Mac Programming 20 Jun 16, 2013 11:55 AM
NSString to NSSize larswik Mac Programming 1 May 28, 2013 07:54 PM
Why can't convert NSString to NSDate? mikezang iPhone/iPad Programming 4 Jan 22, 2013 07:56 PM
Change numbers in NSString newtoiphonesdk iPhone/iPad Programming 3 Jul 9, 2012 11:33 PM
(NSString*) ?? thedon1 iPhone/iPad Programming 6 Jul 2, 2012 08:52 PM

Forum Jump

All times are GMT -5. The time now is 06:29 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC