【发布时间】:2011-07-06 05:32:03
【问题描述】:
我需要在objective c中创建四个Struct
他们是:
typedef struct FILE_TRANSFER_REQUEST_STRUCT
{
uint8_t header[16]; // This would be MD5 of String "SymbolTalk"
uint8_t type; // Type of structure -> FILE_TRANSFER_REQUEST
char fileName[512];
int totalSize; //4096
int chunkSize; //1024
int numChunks; // 4
}FileTransferRequest;
typedef struct FILE_TRANSFER_RESPONSE_STRUCT
{
uint8_t header[16]; // This would be MD5 of String "SymbolTalk"
uint8_t type; // Type of structure -> FILE_TRANSFER_RESPONSE
;
}FileTransferResponse;
typedef struct FILE_CHUNK_REQUEST_STRUCT
{
uint8_t header[16]; // This would be MD5 of String "SymbolTalk"
uint8_t type; // Type of structure -> FILE_CHUNK_REQUEST
uint8_t data[1024];
uint8_t chunkNumber;
uint8_t chunkSize;
}FileChunkRequest;
typedef struct FILE_CHUNK_RESPONSE_STRUCT
{
uint8_t header[16]; // This would be MD5 of String "SymbolTalk"
uint8_t type; // Type of structure -> FILE_CHUNK_RESPONSE
uint8_t chunkNumber;
}FileChunkResponse;
但是我不知道目标结构。我该怎么做。我需要在哪里创建这个结构(需要避免类)。它是否写在目标 c 类文件中。谁能告诉我我怎么能得到这个结构在另一个类中..任何人都可以帮助我...
【问题讨论】:
-
对我来说看起来不错。什么不起作用?
标签: iphone objective-c xcode struct