Reputation: 505
I've got a problem with monotouch. Im not sure how to do toll free bridging.
My code is
NSInputStream iStream;
NSOutputStream oStream;
CFWriteStream cfWrite;
CFReadStream cfRead;
CFStream.CreatePairWithSocketToHost(server, port, out cfRead, out cfWrite);
iStream = (__bridge_transfer NSInputStream)cfRead;
Ok so (__bridge) etc. doesn't exist, but simple casting like
iStream = (NSInputStream)cfRead;
also won't work.
Which is the right way to do this ?
Upvotes: 1
Views: 145
Reputation: 96
Update
NSInputStream constructor is not directly accessible anymore. Use this instead:
using ObjCRuntime;
...
iStream = Runtime.GetNSObject<NSInputStream>(cfRead.Handle);
See here: Documentation
Upvotes: 1