Re: Warning message using stringWithContentsOfFile:encoding:error:
Re: Warning message using stringWithContentsOfFile:encoding:error:
- Subject: Re: Warning message using stringWithContentsOfFile:encoding:error:
- From: Kyle Sluder <email@hidden>
- Date: Sun, 28 Oct 2012 10:37:19 -0700
On Oct 28, 2012, at 10:23 AM, Paul Johnson <email@hidden> wrote:
> Thanks, Nick and Gary. You are absolutely right. I found 'error' is being
> defined in a 3rd-party framework I'm using.
>
> Then there is the question of how to work around this, so I can use the
> NSString class method. If you can suggest a solution I would be grateful.
In order of decreasing simplicity:
1. Don't include the errant header file from your source code.
2. Modify the header file to #undefine error at the end.
3. #undefine error in places you include the header file from.
No matter what you do, file a bug with the 3rd-party framework. Their macros should not leak.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden