我使用了代码
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];
[alertView setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
[alertView show];
我在第
行收到未使用标识符的错误[alertView setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
适用于iOS 9,但不适用于iOS 8.2。如何解决此问题?
答案 0 :(得分:1)
//嗨,semanticContentAttribute属性只能从ios 9.0获得,你需要检查操作系统版本或尝试这样
if ([alertView respondsToSelector:NSSelectorFromString(setSemanticContentAttribute:)]) {
[alertView setValue:[NSNumber numberWithInt:3] forKey:@"semanticContentAttribute"];
}