MacOS 11.3.1 (20E241)
Xcode Version 12.5 (12E262)
objc
// Test URL
https://dwarf.sogoucdn.com/trans/durl/31-193475685vgiwgIi7?action=d&ow_name=testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest.zip
I opened this URL in Safari and Chrome, and I found that Chrome displayed the correct name "testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest.zip", while the file name downloaded by Safari displayed "31-193475685vgiwgIi7".
I captured the WKNavigationResponse object in the delegate of WKWebView and found that the "Content-Disposition" was incomplete.
I tried other URL addresses. If the filename in "Content-Disposition" is very long, this bug will appear.
objc (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]])
{
NSHTTPURLResponse *response = (NSHTTPURLResponse*)navigationResponse.response;
NSString *contentDisposition = [response.allHeaderFields valueForKey:@"Content-Disposition"];
NSLog(@"%@",contentDisposition);
}
}
/*
"Content-Disposition" = (
"attachment; filename=\"testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest"
);/
If I use NSURLSessionDataTask to request, I can get the complete "Content-Disposition"
objc
"Content-Disposition" = (
"attachment; filename=\"testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest.zip\"; filename*=UTF-8''testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest.zip"
);
This question is very important because I embed WKWebView in my app and use it to support file downloading. WKWebView does not seem to support downloading files, but I need to complete its downloading ability.
This problem seems to exist on iOS too
I want to know how I can solve this problem
Post
Replies
Boosts
Views
Activity
Xcode Version 12.4 (12D4e)
MacOS 11.2.3 (20D91)
iPhoneX (iOS 14.4.2)
objc
self.passwordTextField.secureTextEntry = YES;
Select the auto-filled password in the "passwordTextField"(ActionSheet)
After logging in successfully, I found that the height of all NSTextFields in the app is incorrect when the keyboard is switched.
I use "UIKeyboardWillShowNotification" notification to listen for keyboard events
I use UIKeyboardFrameEndUserInfoKey to get the size of the keyboard
If you do not use secureTextEntry, the above problems will not occur
This is my device:
iMac 3.1 GHz 6-core Intel Core i5
APPLE SSD SM0512L
iPhone X
I have a folder with many pictures (50kb~500kb/each), and it takes a long time to read a picture from this folder.
objc
NSURL *filePath = ...
NSData *data = [NSData dataWithContentsOfURL:filePath];
How many files are usually recommended to store in a folder?
Date/Time: 2021-01-21 16:07:47.001 +0800
End time: 2021-01-21 16:09:59.920 +0800
OS Version: macOS 11.1 (Build 20C69)
Architecture: x8664h
Report Version: 32
Incident Identifier: A722D768-2604-4038-B304-CC700C0B43F9
Share With Devs: Yes
Data Source: Microstackshots
Shared Cache: 467A83CB-BA86-3F07-B652-B9256C74080A slid base address 0x7fff20011000, slide 0x11000
Command: Xcode
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 12.3 (17715)
Build Version: 8
Product Build Version: 12C33
Project Name: IDEFrameworks
Source Version: 17715000000000000
App Item ID: 497799835
App External ID: 839512638
Parent: launchd [1]
PID: 4237
Event: cpu usage
Action taken: none
CPU: 90 seconds cpu time over 133 seconds (68% cpu average), exceeding limit of 50% cpu over 180 seconds
CPU limit: 90s
Limit duration: 180s
CPU used: 90s
CPU duration: 133s
Duration: 132.92s
Duration Sampled: 132.59s
Steps: 150
Hardware model: iMac19,1
Active cpus: 6
Fan speed: 1199 rpm
Heaviest stack for the target process:
52 start + 1 (libdyld.dylib + 87585) [0x7fff2033c621]
52 NSApplicationMain + 816 (AppKit + 15858) [0x7fff22bf9df2]
52 -[NSApplication run] + 586 (AppKit + 195338) [0x7fff22c25b0a]
52 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 421 (DVTKit + 89351) [0x10f11ed07]
52 -[NSApplication(NSEvent) nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1366 (AppKit + 251311) [0x7fff22c335af]
52 DPSNextEvent + 883 (AppKit + 257513) [0x7fff22c34de9]
52 BlockUntilNextEventMatchingListInModeWithFilter + 64 (HIToolbox + 201199) [0x7fff2869c1ef]
50 ReceiveNextEventCommon + 709 (HIToolbox + 201932) [0x7fff2869c4cc]
49 RunCurrentEventLoopInMode + 292 (HIToolbox + 202448) [0x7fff2869c6d0]
49 CFRunLoopRunSpecific + 563 (CoreFoundation + 521934) [0x7fff204176ce]
46 _CFRunLoopRun + 2008 (CoreFoundation + 525695) [0x7fff2041857f]
46 CFRunLoopDoTimers + 307 (CoreFoundation + 630594) [0x7fff20431f42]
46 CFRunLoopDoTimer + 922 (CoreFoundation + 631784) [0x7fff204323e8]
46 CFRUNLOOPISCALLINGOUTTOATIMERCALLBACKFUNCTION + 20 (CoreFoundation + 633101) [0x7fff2043290d]
43 NSFireDelayedPerform + 415 (Foundation + 527067) [0x7fff211c5adb]
40 -[DVTTimeSlicedMainThreadActiveWorkQueues processWorkQueuesOnDeadline] + 101 (DVTFoundation + 1932051) [0x10e9b1b13]
40 -[DVTTimeSlicedMainThreadWorkQueue processWithDeadline:] + 167 (DVTFoundation + 1940270) [0x10e9b3b2e]
40 -[DVTTimeSlicedMainThreadOrderedUniquingWorkQueue processWorkItemsWithDeadline:] + 133 (DVTFoundation + 1944953) [0x10e9b4d79]
40 _56-[IDEBuildIssueProvider initWithIssueManager:extension:]blockinvoke + 24 (IDEFoundation + 207834) [0x10f42cbda]
40 -[IDEBuildIssueProvider postBuildIssueChange:] + 873 (IDEFoundation + 225349) [0x10f431045]
40 -[IDEIssueProvider addIssues:forProviderContext:providerSession:container:blueprint:] + 117 (IDEFoundation + 911560) [0x10f4d88c8]
40 -[IDEIssueProvider addIssues:forProviderContext:providerSession:container:blueprint:runtimeGroupingObject:] + 245 (IDEFoundation + 911856) [0x10f4d89f0]
40 -[IDEIssueManager addIssues:forProviderContext:container:blueprint:runtimeGroupingObject:session:tryToCoalesce:] + 929 (IDEFoundation + 349066) [0x10f44f38a]
40 -[IDEIssueManager similarExistingIssueForIssue:container:blueprint:] + 595 (IDEFoundation + 333039) [0x10f44b4ef]
19 -[IDEIssueManager doesIssue:fromContainer:andBlueprint:coalesceWithIssue:] + 314 (IDEFoundation + 332388) [0x10f44b264]
7 -[IDEIssueManager doesIssue:coalesceWithIssue:] + 310 (IDEFoundation + 330520) [0x10f44ab18]
7 -[NSString compare:options:range:] + 34 (Foundation + 20848) [0x7fff2114a170]
2 CFStringCompareWithOptionsAndLocale + 3848 (CoreFoundation + 105140) [0x7fff203b1ab4]
The widget extension is embedded in my objc project, the preview is very slow, and the CPU over 100%
When my program is running, all windows suddenly lose focus and cannot be activated again. I check the activity monitor and show that my program cpu is 100%.
All user interactions are unresponsive, but my program is still alive, and the main thread (UI) is still working normally.
Log - https://developer.apple.com/forums/content/attachment/fad0d285-6f38-469c-aadb-dcb02e7d8e4c
I tried to configure the info.plist file in two ways, but some files cannot be shared through the share menu.
The files that cannot be shared are .txt, .js, .html, .sh, etc.
The files that can be shared are .zip, .png, .mp4, .doc, .xls, etc.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionPrincipalClass</key>
<string>ShareViewController</string>
</dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationRule</key>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsAttachmentsWithMinCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsText</key>
<false/>
</dict>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionPrincipalClass</key>
<string>ShareViewController</string>
</dict>
I updated to Xcode 10 about 1 year ago. When I run the project, Xcode is not smooth. I found that my Xcode cpu occupies 100%, and it will not be smooth for about 1 minute. I have to kill Xcode to ensure that my app can run. If I do this, I can't debug the app. After many attempts, I found that I was using the New build system, and when I switched to the Legacy build system, it went smoothly. Until recently when I upgraded to Xcode 12, I found that the Legacy build system was marked as deprecated. I don't know how I can improve my project in the future. If you use the New build system to debug the project, it is almost impossible for developers to use.
It was successful before Beta 9 was upgraded
Can I successfully notarize the app without changing my computer?
software
macOS Big Sur 11 beta 9 (20A5384c) Xcode Version 12.0.1 (12A7300) crash process
Xcode menu->window->Organizer->Distribute App->Developer ID->Upload->Select certificate and Developer ID profiles->next->crash crash log
xcode_log.crash - https://developer.apple.com/forums/content/attachment/743d8204-ceb8-49e0-9f0e-0351316f3061
I use the ipsec protocol to connect to the VPN successfully in iOS14, and no network can be accessed. There is no such problem in iOS13. If you turn on the VPN in the system settings, it can be used normally, but when connected through NEVPNManager in my app, 90% of the cases are Not available