简体   繁体   中英

Warning in case of ARC?

I am using the following lines of code..

    NSArray *emailArray = (__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(emailProperty);

and I am using ARC , but now when analyze this it gives me a warning that "Potential leak of object emailArray"...

how can I resolve this..? Any help is appreciated.

在这种情况下,您想使用__bridge_transfer ,因为要将复制的数组的所有权转移到NSArray

NSArray *emailArray = (__bridge_transfer NSArray *)ABMultiValueCopyArrayOfAllValues(emailProperty);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM