我一直在使用键盘通知没有任何问题,并获得键盘的准确高度.
- (void)keyboardDidShow:(NSNotification *) notification{
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
NSLog(@"%f",keyboardSize.height);}
Run Code Online (Sandbox Code Playgroud)
但是在iOS 11中,调用通知时键盘的大小为0.
这种情况下出现的问题是什么?我正在使用xcode 9 Beta 5
我正在为uinavigationbar制作自定义栏按钮,我正在使用以下代码
UIImageView *backImgView= [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"chk_back.png"]]; [backImgView setUserInteractionEnabled:YES];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithCustomView:backImgView];
[backButton setTarget:self];
[backButton setAction:@selector(BackBtn)];
checkIn_NavBar.topItem.leftBarButtonItem = backButton;
Run Code Online (Sandbox Code Playgroud)
问题是它没有调用它的行动.我做错了什么?
我在我的项目中使用cocoapods,它工作正常,但升级到 Xcode 14 后,它给出了不同的类型或错误。
首先它要求提供位代码,后来要求开发团队提供,我使用 podfile 中的以下脚本解决了这个问题
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
#config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
config.build_settings['ENABLE_BITCODE'] = 'YES'
config.build_settings["DEVELOPMENT_TEAM"] = " Your Team ID "
end
end
end
Run Code Online (Sandbox Code Playgroud)
解决这些错误后,另一个错误开始出现,即
错误构建:无法进行代码签名,因为目标没有 Info.plist 文件并且不会自动生成。使用 INFOPLIST_FILE 构建设置将 Info.plist 文件应用到目标,或者通过将 GENERATE_INFOPLIST_FILE 构建设置设置为 YES(推荐)来自动生成一个 Info.plist 文件。
我的豆荚已更新,可可豆荚版本是1.11.3
。我该如何解决这个错误?
编辑:
这里提到了一些细节,但没有一个对我有用。
我在Xcode 13上收到以下代码的错误消息
@available(iOS 13.0, *)
case windowScene(_: UIWindowScene, windowLevel: UIWindow.Level)
Run Code Online (Sandbox Code Playgroud)
具有关联值的枚举案例不能用“@available”标记为可能不可用
有谁知道我为什么会收到此错误以及纠正该错误的解决方案是什么?它在 Xcode 12 中运行良好。
我一直在使用以下代码
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:request];
operation.allowsInvalidSSLCertificate=YES;
Run Code Online (Sandbox Code Playgroud)
现在我已将AFNetworking更改为2.0的最新版本.operation.allowsInvalidSSLCertificate不与工作了AFHTTPRequestOperation.根据我使用的文件
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.securityPolicy.allowInvalidCertificates = YES;
Run Code Online (Sandbox Code Playgroud)
我的请求代码是
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog (@"success: %@", operation.responseString);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error: %@", error.description);
}
];
[operation start];
[operation waitUntilFinished];
Run Code Online (Sandbox Code Playgroud)
但这不适用于需要证书的HTTPS.我应该怎么做才能使这项工作?
当我在UIPopoverPresentationController中显示一些视图并将其显示为弹出窗口时
popoverCon?.modalPresentationStyle = UIModalPresentationStyle.popover
Run Code Online (Sandbox Code Playgroud)
内容已向上移动,并且箭头中显示了一部分。
此外,我在弹窗周围有边界
popoverCon?.view.layer.borderColor = .orange
popoverCon?.view.layer.borderWidth = 1.0;
popoverCon?.view.layer.cornerRadius = 10.0;
popoverCon?.view.layer.masksToBounds = false;
Run Code Online (Sandbox Code Playgroud)
它没有朝着箭头所在的部分显示,但在箭头的尖端显示了少许边界线。
在iOS 12之前,它一直工作良好,但在iOS 13中,此问题即将出现。
关于如何解决这个问题有什么建议吗?
我有一个自定义UIButton,我已经在自定义按钮类中实现了触摸委托.
在iPhone 6 Plus之前,每件事情都很好.它上面的所有设备如iPhone 6s和7都会产生问题.
当我点击一个按钮touchesBegan
被按预期调用,但touchesMoved
也被调用,它在我的代码中产生问题.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
_firstTouch = [[touches anyObject]locationInView:self];
_isTapped = YES;
[self.nextResponder.nextResponder touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
_isTapped = NO;
[self.nextResponder.nextResponder touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
if (_isTapped){
//Functionality
}
Run Code Online (Sandbox Code Playgroud)
为什么要touchesMoved
调用这些设备,我该如何解决?
我正在使用以下代码
[UIView animateWithDuration:1.0
delay:0.05
options:UIViewAnimationCurveEaseIn
animations:^{
//Code
} completion:^(BOOL finished) {}];
Run Code Online (Sandbox Code Playgroud)
我收到以下警告
Implicit conversion from enumeration type 'enum UIViewAnimationCurve' to different enumeration type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions')
Run Code Online (Sandbox Code Playgroud)
怎么解决这个?
objective-c uiview uiviewanimation ios uiviewanimation-curve
iOS 13中的viewdidlayoutsubviews中进行了一些更改,导致它在完成其第一次调用(在更改帧上)后在View Controller生命周期的稍后阶段被调用。这在应用程序中产生了一些奇怪的效果。
我观察到的是,在iOS13更改框架之前,不会调用viewdidlayoutsubviews,而在新的iOS 13中,它将被调用。
这是Apple的某种新功能还是某些bug?关于如何停止这种行为有什么建议吗?
公开新的VNDocumentCameraViewController
我找不到任何委托或属性来设置最大扫描次数。
有没有人有解决方法或我可以实施的任何想法来限制一次扫描的数量?
ios ×7
objective-c ×5
ios13 ×3
cocoapods ×1
popover ×1
swift ×1
touchesmoved ×1
uipopoverpresentationcontroller ×1
uiview ×1
vndocumentcameraviewcontroller ×1
xcode ×1
xcode13 ×1
xcode14 ×1