Hi, I have a problem. i want convert my object "Position" in a CFDataRef for sending it in the TCP Socket. I don't know how i can do. Can you help me?
@interface Position : NSObject {
NSString *name;
float valueX;
float valueY;
float valueZ;
}
-(BOOL)setValue:(NSString*)name:(float)valueX:(float)valueY:(float)valueZ;
@property (nonatomic,readwrite, retain) NSString *name;
@property (readwrite) float valueX;
@property (readwrite) float valueY;
@property (readwrite) float valueZ;
@end
//In another class after the correct connection.
Position *tempPosition = [[Position alloc]init];
for(int i=0; i<[arrayPosition count]; i++){
tempPosition = [arrayPosition objectAtIndex:i];
//I want have a CFDataRef of tempPosition for sending. dataSend is my CFDataRef variable
CFSocketSendData(socketAccept, NULL, dataSend, 0);
[NSThread sleepForTimeInterval:1];
}