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?
All objects involved in array creation using
initWithObjectsshould be actual objects. There is no enough code in your question to know iflatandlongtare objects too. Are they?If they aren’t, wrap them with
[NSNumber numberWithFloa:<# the float #>].If that’s not the problem, check SO questions regarding
EXC_BAC_ACCESSto learn to debug them.