Member-only story

Variable is not assignable (missing __block type specifier)

on the line aPerson = participant;. How can I make sure the block can access the aPerson variable and the aPerson variable can be returned?

__block Person *aPerson = nil;

For more details, please refer to this tutorial: Blocks and Variables

or

__block CGFloat docHeight = 0.0;


[self evaluateJavaScript:@"document.height" completionHandler:^(id height, NSError *error) {
//height
NSLog(@"=========>document.height:@%@",height);
docHeight = [height floatValue];
}];

and its working fine

Just add "__block" before Variable.

For more about iOS development : https://medium.com/@javedmultani16

Some useful codes and libraries: https://github.com/javedmultani16

Know more about me: https://www.linkedin.com/in/javedmultani16/

--

--

Mr.Javed Multani
Mr.Javed Multani

Written by Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer

No responses yet