我有一个在 iOS 上运行良好的应用程序,但是当使用催化剂运行时,如果我在 macOS 上滑动到另一个虚拟桌面,然后返回大约 10 次,它会间歇性地让我崩溃。它主要发生在 UICollectionViewController 上
这是回溯:
(lldb) bt
* thread #5, queue = 'com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
* frame #0: 0x00007fff68c373ae libxpc.dylib`___xpc_activity_dispatch_block_invoke.107.cold.3 + 19
frame #1: 0x00007fff68c1ecdb libxpc.dylib`___xpc_activity_dispatch_block_invoke.107 + 746
frame #2: 0x00000001010377b3 libdispatch.dylib`_dispatch_call_block_and_release + 12
frame #3: 0x000000010103878f libdispatch.dylib`_dispatch_client_callout + 8
frame #4: 0x000000010103fd31 libdispatch.dylib`_dispatch_lane_serial_drain + 777
frame #5: 0x0000000101040ae8 libdispatch.dylib`_dispatch_lane_invoke + 438
frame #6: 0x000000010104df2e libdispatch.dylib`_dispatch_workloop_worker_thread + 681
frame #7: 0x00000001010c4053 libsystem_pthread.dylib`_pthread_wqthread + 290
frame #8: 0x00000001010c3eb3 libsystem_pthread.dylib`start_wqthread + 15
(lldb) …Run Code Online (Sandbox Code Playgroud) 我有这个来自 AppAuth 示例的函数,我意识到在 iOS13 中我真的不需要存储 OIDAuthState.authState 的返回值,所以我试图通过删除 来清理代码appDelegate.currentAuthorizationFlow =,但是一旦我删除了它,不再调用回调。并且此 currentAuthorizationFlow 未在代码中的任何其他地方使用。
我还尝试将结果分配给OIDAuthState.authState函数局部变量,其中也不会调用回调。
如果我将 的结果分配给OIDAuthState.authState当前类中的一个类成员变量,那么回调将被调用。
为什么会有这样的行为?这对我来说似乎很莫名其妙。
func signInGmail() {
let redirectURI = URL(string: gmail_kRedirectURI)!
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let config = GTMAppAuthFetcherAuthorization.configurationForGoogle()
let scopes = [OIDScopeOpenID, OIDScopeProfile, OIDScopeEmail, kGTLRAuthScopeGmailReadonly]
let request = OIDAuthorizationRequest.init(configuration: config, clientId: gmail_kClientID, scopes: scopes, redirectURL: redirectURI, responseType: OIDResponseTypeCode, additionalParameters: nil)
appDelegate.currentAuthorizationFlow = OIDAuthState.authState(byPresenting: request, presenting: self, callback: { (authState, error) in
//handleError
if let authState = authState {
let …Run Code Online (Sandbox Code Playgroud) 我正在尝试让我的列表项展开全屏显示。根据材料推荐。PageRouterBuilder看起来很可行,SlideTransition和ScaleTransition都很好用,但是SizeTransition似乎不起作用。当我单击列表项时,新页面立即显示。我希望它会在一开始就被裁剪掉。
下面的代码。
在此先感谢您的帮助!
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
timeDilation = 10.0;
return new MaterialApp(
title: 'Flutter Demo',
home: new MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(title: new Text("Test Expand")),
body: ListView(children: <Widget>[
new ListTile(
title: new Text("Todo 1"),
onTap: () {
_onTap(context, 1);
}),
new …Run Code Online (Sandbox Code Playgroud)