James Bucanek
James Bucanek

Reputation: 3439

Is there a way to mark an Objective-C method that does not return?

In clang, you can mark a C function that does not return like this:

extern void go_die_somewhere( void ) __attribute__((noreturn));

Is there an equivalent attribute for Objective-C methods?

I've tried adding __attribute__((noreturn)) to the method declaration every way I can think of, but the compiler ignores it. I also couldn't find any NS_... macro with the same purpose.

Upvotes: 4

Views: 384

Answers (1)

pointum
pointum

Reputation: 3177

Try + (void) __attribute__((noreturn)) someMethod as used here.

Upvotes: 1

Related Questions