Re: Warning message using stringWithContentsOfFile:encoding:error:
Re: Warning message using stringWithContentsOfFile:encoding:error:
- Subject: Re: Warning message using stringWithContentsOfFile:encoding:error:
- From: Paul Johnson <email@hidden>
- Date: Sun, 28 Oct 2012 12:23:25 -0500
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.
On Sat, Oct 27, 2012 at 7:41 PM, Gary L. Wade
<email@hidden>wrote:
> What you think you're calling is the NSString class method
> +stringWithContentsOfFile:encoding:error: but due to an unexpected
> definition, you're actually calling the NSString class method
> +stringWithContentsOfFile:encoding:Rf_error: Apple does not have a publicly
> defined selector of that name, so that's why you're getting that warning.
> What you need to find is where "error" is being defined, not Rf_error.
> Because C provides for concatenation using the ## operator, you may not
> find that string. I'm guessing you're using someone else's headers,
> framework, or project, possible where error is redefined for some purpose,
> possibly debugging or mapping to another set of code.
> --
> Gary L. Wade (Sent from my iPad)
> http://www.garywade.com/
>
> On Oct 27, 2012, at 4:21 PM, Paul Johnson <email@hidden> wrote:
>
> > Nick, I can't find any headers that #define 'Rf_error'.
> >
> > The warning message seems to be complaining about assigning to the type
> > 'NString *' when type 'id' is expected, though.
> >
> > I'm not sure where Rf_error is defined, but it must be in the Cocoa
> headers.
> >
> > Thanks for your reply.
> >
> > On Sat, Oct 27, 2012 at 5:37 PM, Nick Zitzmann <email@hidden>
> wrote:
> >
> >>
> >> On Oct 27, 2012, at 4:04 PM, Paul Johnson <email@hidden> wrote:
> >>
> >>> I get a compiler warning message at the following line of code:
> >>>
> >>> NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:
> >>> NSUTF8StringEncoding error:&error];
> >>>
> >>> The warning message is:
> >>>
> >>> Class method '+stringWithContentsOfFile:encoding:Rf_error' not found
> >>> (return type defaults to 'id')
> >>>
> >>>
> >>> I've found many code examples that have the same as my code and nothing
> >>> I've tried gets rid of the warning message. Can someone please
> enlighten
> >> me?
> >>
> >> Check the headers. Is there anything that is #defining error to
> Rf_error?
> >>
> >> Nick Zitzmann
> >> <http://www.chronosnet.com/>
> >
>
_______________________________________________
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