我在头文件中定义了一个结构:
#import <UIKit/UIKit.h>
typedef struct ORIGINAL_QUOTA_DATA_tag
{
byte exch;
byte complex_stat;
char contract[8];
byte status;
byte type;
}ORIGINAL_QUOTA_DATA;
@interface NetTestAppDelegate : NSObject <UIApplicationDelegate> {
CFSocketRef _socket;
CFDataRef address;
ORIGINAL_QUOTA_DATA oQuota;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
在我的 .m 文件中:
static void TCPServerConnectCallBack(CFSocketRef socket, CFSocketCallBackType type, CFDataRef address, const void *data, void *info){
memset(&oQuota, 0, sizeof(oQuota));
}
但它会磨损: