I have a problem with NSMutableArray.
In my program i have a lot of variabile “CFSocketRef”.
i want to save this in NSMutableArray but i can’t.
Can you help me?
Thank and sorry for my english XP
My code:
CFSocketRef socketAccept;
NSMutableArray *arrayIP = [[NSMutableArray alloc] init];
self.socketAccept = CFSocketCreateWithNative(NULL,
fd,
kCFSocketDataCallBack,
AcceptDataCallback,
&context);
[arrayIP addObject:(id)self.socketAccept];
You can put a
CFSocketRefinto aNSMutableArrayby wrapping it inside aNSValue:Use
pointerValueto retrieve the value: