简体   繁体   中英

ios app crashes with no log

I have an ios app that i wrote built and tested

then i uploaded it for other people to test

and on their devices the app crashes

I downloaded the link to my original development device , and on my device the app also crashes however, when i run the same version via xcode, the crash never happens.

I have come down to a location in the code which is associated with getting the fields off the screen

i have a method

-(User *) userDetails
{
    User *u = [[User alloc] init];  // <--- this line keeps u nil for some reason

    // though other properties are initialized normally
    // since u is nil, it returns nil

    return u;
}

user file looks like this

@interface User : NSObject
@property (nonatomic,strong)NSString *username;
@property (nonatomic,strong)NSString *password;

@end

@implementation User
//empty file
@end

the app is not running out of memory, it is running on 40MB of ram it seems

my questions is : why, when the app is run not through xcode, user fails to get allocated ?

try to check with exception like

@try
{
     // put your code in side try and if there is any issue then NSLOG return exception. so you can get exet issue in log where is prob.
}
@catch(NSException *e)
{
    NSLog(@"%@",e);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM