3

エラーが発生する

@protocol TapDetectingImageViewDelegate;

@interface TapDetectingImageView : UIImageView {
id <TapDetectingImageViewDelegate> tapDelegate;

@property (nonatomic, assign) id <TapDetectingImageViewDelegate> tapDelegate;

@synthesize tapDelegate;

のようなすべてを試しました

 _weak id <TapDetectingImageViewDelegate> tapDelegate;

 @property (weak) id <TapDetectingImageViewDelegate> tapDelegate;

そしてこれも試してみました

_unsafe_unretained id <TapDetectingImageViewDelegate> tapDelegate;

@property (_unsafe_unretained) id <TapDetectingImageViewDelegate> tapDelegate;

ARCモードを使用しているときに合成が処理するため、インスタンス変数の定義を削除しようとしました。

しかし、このエラーを取り除くためにまだ何も機能していません。

誰かがこのエラーを解決するのを手伝ってくれるなら。

ありがとう。

4

1 に答える 1

0

私は Obj-C を初めて使用します。このソリューションhttps://stackoverflow.com/a/10080387/3867557を見つけました 。コードは次のようになります。

@protocol TapDetectingImageViewDelegate;
@interface TapDetectingImageView : UIImageView 
@property (nonatomic, assign) id <TapDetectingImageViewDelegate> tapDelegate;

それが役立つことを願っています。

于 2015-03-23T12:43:39.353 に答える