Re: How to get rid of Warning
Re: How to get rid of Warning
- Subject: Re: How to get rid of Warning
- From: Dave <email@hidden>
- Date: Fri, 17 Jun 2016 08:56:37 +0100
Hi and thank you so much for this, I’ve been trying to get rid of that warning for ages!
> On 16 Jun 2016, at 16:47, じょいすじょん <email@hidden> wrote:
>
> If you're using NS_ASSUME_NONNULL
> you can get away with:
> withError:(NSError *__nullable*)
>
> It's an outError (out parameter) which in C parlance is a pointer to a pointer.
> By convention it is a pointer to a pointer declared as NSError type but set to nil.
> It's easy to forget, so I keep a snippet in Xcode triggered by the keyword outError to fill it in for me.
>
> My snippet predates things a bit and might be overkill with
> error:(out NSError * __nullable __autoreleasing * __nullable)outError
>
> But I copied it from Apple frameworks, I believe NSFileManager, some time back.
> The second nullable means you can just pass nil meaning you don't want the error back at all, though that's probably fallen out of fashion.
> out is as I recall just a helper to the compiler.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden