iphone - Program receives Exc_bad_access signal and crashes -


i issue while accessing address book of user. code is

abmultivalueref email = abrecordcopyvalue(asource, kabpersonemailproperty);         nsstring* email_lbl;         for(cfindex = 0; < abmultivaluegetcount(email); i++) {             email_lbl = (nsstring*)abmultivaluecopylabelatindex(email, i);             if([email_lbl isequaltostring:(nsstring *)kabhomelabel])             {                home_email = [(nsstring*)abmultivaluecopyvalueatindex(email, i)retain];             }             if([email_lbl isequaltostring:(nsstring *)kabworklabel])             {                work_email = [(nsstring*)abmultivaluecopyvalueatindex(email, i)retain];             }             if([email_lbl isequaltostring:(nsstring *)kabotherlabel])             {                 basic_email = [(nsstring*)abmultivaluecopyvalueatindex(email, i)retain];             }          } 

there exc_bad_access signal received when log home_email, work_email, basic_email.

i found solution self. declared home_email, work_email, basic_email didn't initialized them , time printing them in log not initialized. solved issue.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -