// macaddress = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
// }
// if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
// macaddress = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
// }
//write data to pasteboard
UIPasteboard *paste = [UIPasteboard pasteboardWithName:@"macroos" create:YES];
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"1920", @"UID", @"samuel", @"NAME", nil];
[paste setData:[NSKeyedArchiver archivedDataWithRootObject:dic] forPasteboardType:@"org.OpenUDID"];
//read data from pasteboard
paste = [UIPasteboard pasteboardWithName:@"macroos" create:YES];
NSData *value = [paste dataForPasteboardType:@"org.OpenUDID"];
NSDictionary *decDic = [NSKeyedUnarchiver unarchiveObjectWithData:value];
NSLog(@"uid:%@, name:%@", [decDic objectForKey:@"UID"], [decDic objectForKey:@"NAME"]);
http://blog.youkuaiyun.com/jwzbskywz/article/details/7703140
本文介绍如何在iOS平台上获取设备的唯一标识符,并演示了使用剪贴板进行数据写入与读取的过程,包括将自定义数据存入剪贴板及从剪贴板中读取数据的方法。
2656

被折叠的 条评论
为什么被折叠?



