Suppress warning for deprecated method when there's no alternative for it

4 Solutions Collect From Internet About “Suppress warning for deprecated method when there's no alternative for it”

please read the change notes it clearly says use init method

Edit: as it’s going in the infinite loop use [super init] instead of [self init]

- (id)init
{
   // return [self init]; 
      return [super init];
}

It looks like the developer marked this as deprecated and suggests using the init method. You can edit the 3rd party library to remove this attribute or suppress it. Perhaps moving the contents of initWithParentView into init would be a better fix of the library.

/*!
 DEPRECATED: Use the [CustomIOS7AlertView init] method without passing a parent view.
 */
- (id)initWithParentView: (UIView *)_parentView __attribute__ ((deprecated));
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (void) methodUsingDeprecatedStuff {
    //use deprecated stuff
}
#pragma clang diagnostic pop

This should suppress it.

Well, the *.h of the class tells you what to do

/*! DEPRECATED: Use the [CustomIOS7AlertView init] method without passing a parent view. */

So if you’re overriding the custom class just use

[self init];

else use

[[CustomIOS7AlertView alloc] init]