Re: NSAssert Error output contains source code path
Re: NSAssert Error output contains source code path
- Subject: Re: NSAssert Error output contains source code path
- From: "Sean McBride" <email@hidden>
- Date: Sat, 10 Mar 2007 01:18:09 -0500
email@hidden (email@hidden) on 2007-03-09 16:14 said:
>> I just had something odd happen... A user of the software project I
>> inherited ran into a program error. There's an NSAssert in the code
>> whose result is output to console. The error shows the path of the
>> class when it was compiled:
>>
>> *** Assertion failure in -[blahblah resizeImages], /Users/jaimelm/
>> project/blablah.mm:1593
>
>The NSLog() or whatever is printing __FILE__, which hardcodes the path of
>the sourcecode into a string. That's a common debugging technique. There
>is also __LINE__, as shown in the 1593.
And with CodeWarrior __FILE__ gives blablah.mm. With Xcode/gcc (by
default anyway, as Jaime discovered) it gives the full path. The list
archives have discussions on this.
Sean
--
1908's Model T Ford: 25 miles per gallon. Today's Ford Expedition: 15.5 mpg.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden