himanth himanth - 4 months ago 16
iOS Question

How to assign non-null property to button?

I am declaring an action for UIButton in myviewcontroller.h file like this

- (IBAction)loginClicked:(id)sender;


but I can see warning like
Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
.
How can I resolve this issue?

thanks

Answer

Replace

- (IBAction)loginClicked:(id)sender

With

-(IBAction) loginClicked:(nonnull id)sender

Read more at: https://developer.apple.com/swift/blog/?id=25

Comments