Re: NSURL from non-url NSString

2014-05-25 Thread Jens Alfke
On May 25, 2014, at 8:05 AM, Koen van der Drift wrote: > However, I noticed that strings that have the form P12345 also turn blue. > Any idea why that string would turn into an NSURL? The url scheme is nil, > and the path components just show P12345. It’s a relative URL — just a single p

Re: NSURL from non-url NSString

2014-05-25 Thread Koen van der Drift
Alright, thanks all, I'll have a look at NSDataDetectors. Happy Sunday, - Koen. On May 25, 2014, at 11:29 AM, Mike Abdullah wrote: > > On 25 May 2014, at 16:05, Koen van der Drift > wrote: > >> Hi, >> >> At one point in my code I need to recognize an URL to show in a different >> color.

Re: NSURL from non-url NSString

2014-05-25 Thread Mike Abdullah
On 25 May 2014, at 16:05, Koen van der Drift wrote: > Hi, > > At one point in my code I need to recognize an URL to show in a different > color. Pretty standard: > >NSURL *url = [NSURL URLWithString: aString]; > >if (url) // if url is created change color >{ >NSAttribute

Re: NSURL from non-url NSString

2014-05-25 Thread Ken Thomases
On May 25, 2014, at 10:05 AM, Koen van der Drift wrote: > At one point in my code I need to recognize an URL to show in a different > color. Pretty standard: > >NSURL *url = [NSURL URLWithString: aString]; > >if (url) // if url is created change color > Works great, if aString starts

Re: NSURL from non-url NSString

2014-05-25 Thread Uli Kusterer
On 25 May 2014, at 08:20, Koen van der Drift wrote: > I haven't figured that out yet, hence my question, maybe someone would > recognize it. But so far I've seen it it for single word strings that begin > with a letter, followed some numbers and letters. Off the top of my head, I’d not have e

Re: NSURL from non-url NSString

2014-05-25 Thread Koen van der Drift
I haven't figured that out yet, hence my question, maybe someone would recognize it. But so far I've seen it it for single word strings that begin with a letter, followed some numbers and letters. - Koen. On May 25, 2014, at 11:11 AM, Uli Kusterer wrote: > On 25 May 2014, at 08:05, Koen van

Re: NSURL from non-url NSString

2014-05-25 Thread Uli Kusterer
On 25 May 2014, at 08:05, Koen van der Drift wrote: > However, I noticed that strings that have the form P12345 also turn blue. > Any idea why that string would turn into an NSURL? The url scheme is nil, > and the path components just show P12345. What is “the form P12345”? What’s the comm

NSURL from non-url NSString

2014-05-25 Thread Koen van der Drift
Hi, At one point in my code I need to recognize an URL to show in a different color. Pretty standard: NSURL *url = [NSURL URLWithString: aString]; if (url) // if url is created change color { NSAttributedString *linkString = [[NSAttributedString alloc] initWithString: