Objective C - deallocated variable -
I have this static / singleton class in which the member variable is
everything works fine, However, when I left the app and came back, that member is crashing the variable app.
I tried to resume the member variable, but this does not seem like.
I am including the samples of my code below, have anyone seen before this?
Header (.h) File:
@ Interface Metrics: NSOJs {Metrics * Metrics; Distance * distance; } Implementation (.m) file:
@ Milan matrix static metrics * metric = zero; + (Metrics *) Shared Instruction {@ Synchronize (Self) {If (Matrix == zero) {Metrics = [[Metrics Alok] init]; }} Return metric; } - (id) init {self = [super init]; If (self) {} returns back to himself; } - (zero) SetupDistance {distance = [[Remote Alok] init]; Distance.test; and it is used, where it is AppDelegate.m
- (zero) applicationDidbackActive: (UIApplication *) application {{[[Matrix Share Instance ] SetupDistance]; } Thanks,
T
Skip the app "you almost certainly mean" send the app in the background ". This does not end your application. When you are activated again, you are leaking distance and can tell a new name. I suspect that any problem in the test is actually a problem. First of all, leaving your code, leaving your code directly init and dealloc . Use the accessories to remove most of your problems. Second, do not set the call code in the specialty in applicationDidBecomeActive . You mean to call it in applicationDidFinishLaunchingWithOptions: . But better yet, just start it during Metrics init Why is this internal metrics description in app representative?
Comments
Post a Comment