Re: String causes NSLog to crash
Re: String causes NSLog to crash
- Subject: Re: String causes NSLog to crash
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 24 Feb 2006 11:42:49 -0700
On Feb 24, 2006, at 11:34 AM, Sunil Vemuri wrote:
NSString* test = @"http://images.google.com/imgres?imgurl=http://
jameselee.myblogsite.com/EXAMPLE%20-%20RSS%20Icon%
25202.gif&imgrefurl=http://jameselee.myblogsite.com/
&h=14&w=36&sz=1&tbnid=lLM7cy-
VxzIJ:&tbnh=14&tbnw=36&hl=en&start=28&prev=/images?q=xml+rss%
2Bicon&start=20&svnum=10&hl=en&lr=&client=safari
&rls=en-us&sa=N";
NSLog(@" link:%@", test);
NSLog(test);
[...]
I'm curious if anyone has any insight into what may be going wrong
here.
NSLog() takes a varargs-formatted string as its first argument, so if
there are any % characters in the string, as there are in that test
string, then it will treat them as formatting characters. But since
you didn't provide any other arguments to NSLog() to fill them in,
then the program crashes.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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