App crash only on iPhone Device and not in Simulator

后端 未结 5 1634
予麋鹿
予麋鹿 2020-12-11 12:21

In my app, when I press a button the method called for that button first assigns my textfield texts directly to NSArray object like:

 val = [[NS         


        
5条回答
  •  长情又很酷
    2020-12-11 13:00

    Most probably your app is crashing due to memory issues since it is not crashing in simulator, try to release all objects that you allocate at the points you are done with them.

    If you have your custom objects which you allocate and initialize as;

    MyCustomClass *myObject = [[MyCustomClass alloc] init];

    you need to release them as

    [myObject release];

    especially if they have members which are assigned big sized images or other kind of data.

    If your app starts to crash less after you start solving these memory management issues, it shows that you are on the right way. So keep releasing.

提交回复
热议问题