views:

107

answers:

1

Hi,

I am new to this i phone app programming. I have a function with one argument type as structure pointer. This is shown below

-(void)responce:(structurePtr *)someData
{
......
......
}

I want to call this function using performselector method after 5 seconds of time interval.

I have used below code to perform the activity

[self performSelector:@selector(responce:) withObject:someData afterDelay:5];

this is not even called the responce function. By executing above performselector it is crashing and showing the EXc_BAD_ACCESS message.

please tell me why it is not calling the responce function.

one more thing is that it is showing one warning in above performSelector calling as "passing argument 2 of performSelector: withObject: afterDelay: from incompatable pointer type"

+1  A: 

     It looks like that your structurePtr is a plain c structure and performSelector: requires 2nd parameter to be a obj-c object (an id type).
     It is also may be a good policy to build your project with "Treat warning as errors" option on. Very often warning at compile time become run-time errors...

Vladimir