這裏是一個Cr4zY速戰速決,如果你是在一個真正着急只使用(像我現在,船舶,毋寧死!) ...
使用的工具,像0xED http://www.suavetech.com/0xed/將libspotify
二進制文件中的uniqueIdentifier
部分更改爲uniqueXdentifier
之類的內容。 (注意!必須具有相同的長度,或者它會破壞硬盤!!!)
然後添加一個類方法即像這樣在您的項目(使用相同的名稱改爲)
static NSString *alternativeUniqueIdentifier = nil;
#define DEFAULTS_KEY @"heartbreakridge" // "Improvise, adapt, overcome" - Clint Eastwood in DEFAULTS_KEY
@interface UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier;
@end
@implementation UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier
{
if (!alternativeUniqueIdentifier) {
@synchronized(self) {
alternativeUniqueIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:DEFAULTS_KEY];
if (!alternativeUniqueIdentifier) {
// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (capital hex)
CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
CFRelease(uuidRef);
alternativeUniqueIdentifier = [(NSString*)CFBridgingRelease(uuidStringRef) lowercaseString];
alternativeUniqueIdentifier = [alternativeUniqueIdentifier stringByReplacingOccurrencesOfString:@"-" withString:@""];
alternativeUniqueIdentifier = [NSString stringWithFormat:@"%@%@", [alternativeUniqueIdentifier substringToIndex:8], alternativeUniqueIdentifier];
[[NSUserDefaults standardUserDefaults] setValue:alternativeUniqueIdentifier forKey:DEFAULTS_KEY];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}
return alternativeUniqueIdentifier;
}
@end
這個問題似乎是題外話,因爲它是關於一些錯誤或libspotify本身的問題。它會更適合將它發佈到他們的問題跟蹤器等。 – quetzalcoatl 2013-12-13 15:37:48