Reputation: 85
Am I supposed to explicitly free memory when I get a struct returned from a function such as NSMakeRange() when using ARC in Objective-C?
Upvotes: 1
Views: 164
Reputation:
No. You couldn't even do that either. It's not an object, it's not something allocated using malloc()
, nothing like that. It's a primitive value that gets copied whenever necessary and vanishes when its scope ends.
when using ARC in Objective-C?
Yes. And when not using it. It doesn't matter - ARC and MRC are concerned with Objective-C objects only. Not with those with automatic storage duration, not with those allocated by the C standard library functions.
Upvotes: 3