【发布时间】:2017-02-24 22:22:59
【问题描述】:
我有一个 C API 调用如下:
- (NSData*)getFileContents {
NSData *fileContents;
//do something
return fileContents;
}
-(void*) manipulateFile {
UInt8 *data = (UInt8*) [[self getFileContents] bytes];
UInt32 dataLength = (UInt32)[[self getFileContents] length];
//call some C API with the data and dataLength value
}
现在我的问题是因为我不必明确调用free(data) 我想知道bytes 调用的幕后发生了什么
【问题讨论】:
标签: objective-c memory-management free