使用本机“共享"对话框发布到Facebook上的iOS错误-UICGColor encodeWithCoder [英] IOS erro at Posting to Facebook with the native Share dialog - UICGColor encodeWithCoder
问题描述
错误:
-[UICGColor encodeWithCoder:]中的断言失败, /SourceCache/UIKit/UIKit-2372/UIColor.m:1191 2012-11-15 14:17:45.531 Neemu Clothes [15179:4d07]由于未捕获的异常而终止了应用程序 "NSInternalInconsistencyException",原因:仅支持RGBA或 白色空间,这种方法很不实用. * 首次抛出调用堆栈:(0x363272a3 0x32afe97f 0x3632715d 0x37a492af 0x36c793c5 0x379ec00f 0x379eb8b5 0x36dac72d 0x36daba7b 0x3632462f 0x36dab7f5 0x36e895e5 0x36e17cd7 0x36e17b6d 0x3506890f 0x36e17a61 0x36e210d5 0x3505b83b 0x36e210b1 0x3505b11f 0x3505a99b 0x3505a895 0x35069215 0x350693b9 0x357f8a11 0x357f88a4) libc ++ abi.dylib:终止引发异常
Assertion failure in -[UICGColor encodeWithCoder:], /SourceCache/UIKit/UIKit-2372/UIColor.m:1191 2012-11-15 14:17:45.531 Neemu Clothes[15179:4d07] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only support RGBA or the White color space, this method is a hack.' * First throw call stack: (0x363272a3 0x32afe97f 0x3632715d 0x37a492af 0x36c793c5 0x379ec00f 0x379eb8b5 0x36dac72d 0x36daba7b 0x3632462f 0x36dab7f5 0x36e895e5 0x36e17cd7 0x36e17b6d 0x3506890f 0x36e17a61 0x36e210d5 0x3505b83b 0x36e210b1 0x3505b11f 0x3505a99b 0x3505a895 0x35069215 0x350693b9 0x357f8a11 0x357f88a4) libc++abi.dylib: terminate called throwing an exception
代码:
BOOL displayedNativeDialog = [FBNativeDialogs presentShareDialogModallyFrom:self initialText:@"NeeemuG - Veja meu look." image:nil url:[NSURL URLWithString:@"https://www.neemu.com"] handler:^(FBNativeDialogResult result, NSError *error) {
// Only show the error if it is not due to the dialog
// not being supporte, i.e. code = 7, otherwise ignore
// because our fallback will show the share view controller.
if (error && [error code] == 7) {
return;
}
NSString *alertText = @"";
if (error) {
alertText = [NSString stringWithFormat:
@"error: domain = %@, code = %d",
error.domain, error.code];
} else if (result == FBNativeDialogResultSucceeded) {
alertText = @"Posted successfully.";
}
if (![alertText isEqualToString:@""]) {
// Show the result in an alert
[[[UIAlertView alloc] initWithTitle:@"Result"
message:alertText
delegate:self
cancelButtonTitle:@"OK!"
otherButtonTitles:nil]
show];
}
}];
// Fallback, show the view controller that will post using me/feed
if (!displayedNativeDialog) {
NSLog(@"No IOS6.");
}
推荐答案
在我的代表中,我将[[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background"]]放入背景导航栏,我不知道为什么会崩溃,但是当我删除决心时 问题.
In my delegate i put [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background"]] to background navigation bar, i dont know why this crash, but when i remove resolve the problem.
这篇关于使用本机“共享"对话框发布到Facebook上的iOS错误-UICGColor encodeWithCoder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!