이미지가있어서 다른 기기로 블루투스를 통해 전송해야합니다.sendResourceAtURL 멀티 페어 IOS7
NSData *Recording = [NSData dataWithContentsOfFile:myFilePath];
NSString* str = [NSString stringWithFormat:@"%@.ext", button.titleLabel.text];
myDictionary = [[NSMutableDictionary alloc] init];
[myDictionary setObject:str forKey:@"fileName"];
[myDictionary setObject:@"Recording" forKey:@"fileType"];
[myDictionary setObject:Recording forKey:@"FileData"];
NSData* myData = [NSKeyedArchiver archivedDataWithRootObject:myDictionary];
가 나는 다음과 같은 방법을 사용하여 MYDATA 또는 내 사전 중 하나를 보낼 필요가 : 데이터는이 당신이 내가 URL에서 자원을 보내야 볼 수 있듯이
progress = [session sendResourceAtURL:anUrl withName:[imageUrl lastPathComponent] toPeer:peerID withCompletionHandler:^(NSError *error) {
// Implement this block to know when the sending resource transfer completes and if there is an error.
if (error) {
NSLog(@"Send resource to peer [%@] completed with Error [%@]", peerID.displayName, error);
}
else {
// Create an image transcript for this received image resource
}
}];
를, 수신기는받을 것이다 "url"에있는 리소스와 그 url에서 NSMutabledictionary를 얻어야합니다. 기본적으로이 myDictionary를 보내야하지만 URL이 어떻게 작동하는지 파악하는 데 문제가 있습니다. 아무도 내가 사용하는 URL과 그것을 만드는 방법을 설명 할 수 있습니까?