2009-10-16 65 views
0

这是下面的一段从WiTap代码,WiTap实施例在iPhone

- (void) send:(const uint8_t)message 
{ 
if (_outStream && [_outStream hasSpaceAvailable]) 
     if([_outStream write:(const uint8_t *)&message maxLength:sizeof(const uint8_t)] == -1) 
       [self _showAlert:@"Failed sending data to peer"]; 
} 

- (void) activateView:(TapView*)view 
{ 
    NSLog(@"ACTIVATE TAG: %d", [view tag]); 
    //[self send:[view tag] | 0x80]; 
    [self send:[view tag]]; 
} 

- (void) deactivateView:(TapView*)view 
{ 
    NSLog(@"DEACTIVATE TAG: %d", [view tag]); 
    //[self send:[view tag] & 0x7f]; 
    [self send:[view tag]]; 

} 

是否有可能发送使用WiTap文件? 如何使用发送方法发送NSData?

谢谢

回答