I’m trying to place a function inside another function, but I’m getting:
‘self’ was not declared in this scope
This is the code:
-(void) alone {
label.text = [NSString stringWithFormat:@"Hello world"];
}
void *multithreading( void *ptr ) {
[self alone];
}
Well then O found out, that the warning/error goes away if the last code is changed to:
-(void *) multithreading:( void * )ptr {
[self alone];
}
I’m trying to keep multithreading stay the same way or else my code won’t work, so please help me out.
You can not access objective-c variable in c function. you should pass
selfas parameter to c function .