• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Warnings with NSError **
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warnings with NSError **


  • Subject: Re: Warnings with NSError **
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 16 Dec 2005 17:02:32 +0000

On 16 Dec 2005, at 13:06, Jonathon Mah wrote:

Hi all,

I have a class with a few convenience constructors which take an NSError ** as a parameter:


+ (id)patchWithContentsOfFile:(NSString *)path error:(NSError **) outError
{
return [[[self alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:outError] autorelease];
}

- (id)initWithContentsOfURL:(NSURL *)patchURL error:(NSError **) outError
{ // Stuff }


The 'return' line always generates a warning:
passing argument 2 of ‘initWithContentsOfURL:error:’ from distinct Objective-C type

I've tried explicitly casting outError to (NSError **) and a couple of other things. I'm using GCC 4.0.1 (it also happened on 4.0.0).

What can I do to silence the warning?

Did you forget to declare the -initWithContentsOfURL:error: constructor in your interface? If you'd done that, and there was already a constructor with a similar name in a base class but with different type parameters, you might get that message.

Kind regards,

Alastair.

--
http://www.alastairs-place.net


_______________________________________________
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
References: 
 >Warnings with NSError ** (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Re: Synchronizing scolling of NSTextView and NSTableView
  • Next by Date: Re: Warnings with NSError **
  • Previous by thread: Warnings with NSError **
  • Next by thread: Re: Warnings with NSError **
  • Index(es):
    • Date
    • Thread