Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
923 views
in Technique[技术] by (71.8m points)

objective c - App crash only on iPhone Device and not in Simulator

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 = [[NSArray alloc] initWithObjects: nameText.text, cellText.text, p_emText.text, 
                                      p_cnfrmText.text, s_emText.text, s_cnfrmText.text,
                                      emailText.text, ecnfrmText.text, lat, longt,  
                                      nil];

when I run my app on simulator no app crashing occurs, but when I run it on my iPhone device it gives: Thread 1: program recieved signal "EXC_BAC_ACCESS"

Can anybody tell why this happens and what's the solution for this scenario?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In XCode, go to menu "edit scheme", choose the running configuration and add 'NSZombieEnabled' like in the picture below, when your apps crashes, it will provide you additional infos on the crash that should help you debug it.

enter image description here

EDIT

Note that when your application debug is over, remove the NSZombieEnabled command as it impacts the application performances


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...