私の .h ファイルには次のものがあります。
@protocol ScanBookDelegate
- (void)MethodNameToCallBack:(NSArray *)s;
@end
@property (nonatomic, weak) id <ScanBookDelegate> delegate;
私の .m ファイルには次のものがあります。
@synthesize delegate;
次のエラーが表示されます。
Existing ivar 'delegate' for __weak property 'delegate' must be __weak
このエラーを解決するにはどうすればよいですか?
NSArray *
JSON結果からデータを返しているので、を返しています。
アップデート:
これが私の.hファイル全体です-
#import <UIKit/UIKit.h>
@protocol ScanBookDelegate
- (void)MethodNameToCallBack:(NSArray *)s;
@end
@interface jabBookScan : NSObject
<NSURLConnectionDelegate, NSURLConnectionDataDelegate>
{
NSURLConnection *internalConnection;
NSMutableData *container;
id <ScanBookDelegate> delegate;
}
- (id)initWithRequest:(NSURLRequest *)req;
- (void)start;
- (NSMutableData *) lookupBook:(NSString *) isbn;
- (void)fetchedData:(NSData *)responseData;
@property (nonatomic, copy) NSURLRequest *request;
@property (nonatomic, copy) void (^completionBlock)(id obj, NSError *err);
@property (nonatomic, strong) NSDictionary *jsonRootObject;
@property NSMutableData *responseData;
@property NSURL *myURL;
@property (nonatomic, weak) id <ScanBookDelegate> delegate;
@end