开发者

Foundation Library Causing Leak in application

开发者 https://www.devze.com 2023-02-23 08:38 出处:网络
CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [networkInfo subscriberCellularProvider];

Foundation Library Causing Leak in application

Foundation Library Causing Leak in application

CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
    CTCarrier *carrier = [networkInfo subscriberCellularProvider];
    NSString *currentCountry=[carrier isoCountryCode];
    [networkInfo release];

I am using this piece of code in my application t开发者_Python百科o determine the country of user.I am getting leaks because of this and instruments shows the responsible library as foundation.I am using IOS 4.1 for testing.How can this be fixed.


What is leaking? Where is it retained/released?

Keep in mind that when Instruments identifies a leak, it is showing you where the leak was allocated and not the location where it might be over-retained. There certainly are leaks in the system frameworks, but they are few and far enough between that it is safe to assume it is caused by your code until proven otherwise.

0

精彩评论

暂无评论...
验证码 换一张
取 消