Search code examples
ioscocoapodsautomatic-ref-countingpodspec

'cocoapods' how to edit podspec file


Example taken from https://guides.cocoapods.org/syntax/podspec.html#requires_arc:

spec.requires_arc = ['Classes/*ARC.m', 'Classes/ARC.mm']

What is the meaning of the following? Can you give an example that to use? Thanks!

Classes/*ARC.m 
Classes/ARC.mm

Solution

  • According to the Cocoapods documentation (which you're presumably looking at right now), your choices are "true", "false" or the actual files that require ARC ().

    So for the Podspec pattern spec.requires_arc = ['Classes/*ARC.m', 'Classes/ARC.mm'] you'd be saying that any files in the "Classes" directory that are either named ARC.mm or *ARC.m (i.e. * being a wildcard so "ChenFanFangARC.m would be a valid match while ARCMichael.m is not), these files are expected to work with Automated Reference Counting.

    All other files compiled for this pod would have ARC turned off.