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.
精彩评论