I have been working on an iOS App for sometime now and its almost ready to submit. However, when I gave it to few people for testing purposes (running iOS 5)..they reported cases where the app crashes and the home screen is displayed on the phone OR a frozen app screen appears with no response whatsoever
The app is ARC enabled and Xcode shows no warnings. So, I’m relli tensed about what’s going wrong. I have declared properties in the following fashion:
@property (nonatomic) IBOutlet UILabel *devCountLabel;
@property (nonatomic) IBOutlet UIView *splashView;
Likewise other properties are declared. Could anyone provide a solution? It is mainly a network based app and thus, CoreData usage is minimum.
PS: The App doesn’t crash in the simulator, so I’m guessing it has something related to memory. And the crashes are random. So, repeating a set of steps to reproduce the crash doesn’t help either.
For Eg. When I click a button, modalViewControllerAnimation results in normal case. Now this occurs as expected most of the time and freezes the app other times.
The crash logs will help, but here is my guess:
Interface Builder Outlet properties should be
weak, so they becomenilafter they get released.In your code their semantics is
assign(it’s by default, since you wrotenonatomiconly), which is used for primitive types. And when it gets released, you get a dangling pointer, and when you use it, the app crashes.Try this: