__block attribute on instance variable issue.
问题 I have encountered the following error while compiling an Objective-C class: VideoView.h:7: error: __block attribute can be specified on variables only Also here is the important part of the header file: #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface VideoView :UIView{ @private __block AVPlayer *player; } ... Is there any explanation why g++ thinks that I'm applying the __block attribute on a non-variable object ? 回答1: You can't have __block on an instance variable