iDia
iDia

Reputation: 1397

how to solve EXC_BAD_ACCESS

I'm new to iOS,, I got an EXC_BAD_ACCESS exception in following line

nextscrn.fullTextValue=self.fulltextFromSecond;

This nextscrn object has created in this way above to that line.

ImageVisible *nextscrn=[[ImageVisible alloc]initWithNibName:nil bundle:nil];

Can any one explain me what is the reason for this and how can I solve this.

Thanks

Upvotes: 1

Views: 193

Answers (1)

paxdiablo
paxdiablo

Reputation: 882566

If nextscrn.fullTextValue=self.fulltextFromSecond; is the line where you're getting the exception then almost certainly one of nextscrn or.self is set to an invalid pointer.

First step is to establish which one it is, then find out why it got that way.

One way to establish which is the problem is with debugging tools (probably the best way). If that's not possible, you can try something like:

void *xyzzy = self.fulltextFromSecond;

and see if that crashes (I've used void * because I don't know what type your self is, but you should probably substitute the "real" type).

If that crashes, it's the self that's corrupted but I'd consider this possibility the least likely. If not, try a similar method for nextscrn.fullTextValue.

Upvotes: 1

Related Questions