Hi folks,I'm a newbie to Cocoa. Recently, I'm working on a project relating to Resource Management. In my project, there's a part that I'm reading through the resources in a resource file. I'm using: int count = CountResources( typeName ); to get all resource that has the type "typeName", then loop through this resource list to take resource data out.
for (n = 1; n <= count; n++) { Handle dataHandle = Get1IndResource( type1, n); .... NSData *data = [NSData dataWithBytes: *dataHandle length: GetResourceSizeOnDisk(dataHandle)]; // I GOT AN ERROR HERE //using data struct A_STRUCT aStruct; memcpy(& aStruct,[data bytes], [data length]); } After several times looping through the list, I got an error in the line above. But if I use data directly, like the following code, there is no error occurred. memcpy(&pgControlRes,*dataHandle, GetResourceSizeOnDisk(dataHandle)); Any suggestions for my problem. I highly appreciate all your helps. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]