在我的 .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