0

I added UrbanAirship libraries to my code, and I am getting these kinds of error when compiling UAPushSettingsAliasViewController.m and UAInboxMessageListCell.m and a few similar classes. The errors happen on this method:

- (void)dealloc {

    RELEASE_SAFELY(tableView);
    RELEASE_SAFELY(aliasCell);
    RELEASE_SAFELY(textCell);
    RELEASE_SAFELY(textLabel);
    RELEASE_SAFELY(aliasField);

    [super dealloc];
}

and most of the errors are "release not available: not available in automatic reference counting mode"

Would anyone know why this is happening and how I can resolve this?

Thanks, Alex

Genadinik
  • 18,153
  • 63
  • 185
  • 284

1 Answers1

1

This is because you are using features such as dealloc, release and retain, which aren't needed in ARC as it automatically manages memory. You can turn off ARC in build settings, or add -fno-objc-arc to the compiler flags on the files that don't use ARC.

In build settings enter image description here

For the -fno-objc-arc, add it here

enter image description here

Add it by double clicking on compiler flags and add it for the files that contain things like retain, autorelease, release, and [super dealloc].

Chris Loonam
  • 5,735
  • 6
  • 41
  • 63