When i use Xcode16 Beta4, I finish some code
for example
@available(iOS 18.0, *)
struct Test001ControlWidget: ControlWidget {
let kind: String = "Test001ControlWidgetKind"
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: kind, content: {
ControlWidgetButton(action: Test001ControlAppIntent(), label: {
HStack {
Image("controlcenter_point")
Text("Test001")
}
})
})
.displayName("Test001")
}
}
@available(iOS 18.0, *)
struct Test001ControlAppIntent: AppIntent {
static let title: LocalizedStringResource = "Open Demo Some Page"
static var isDiscoverable: Bool = false
static var openAppWhenRun: Bool = true
func perform() async throws -> some IntentResult & OpensIntent {
let defaultIntent = OpenURLIntent()
guard let url = URL(string: Test001JumpType.sohuWatchPoint.jumpLink()) else { return .result(opensIntent: defaultIntent) }
return .result(opensIntent: OpenURLIntent(url))
}
}
The icon can be displayed normally and icon type is png.
And deep link also jump normally.(Note: The control widget file target membership are main app and widgetExtension)
But iOS18 RC code is no working and icon show "?"
How do I deal with these issues?
I hope to hear from you soon.
Tks a lot...
Post
Replies
Boosts
Views
Activity
Hello, I have a crash that is difficult to solve because I don't know how to solve it, it appears on any model, on any system.It appears 2-3 times in almost every version.
Because I am responsible for the module that crashed and until today I had no solution, so I am asking for your help and hope that the Apple engineers can give me an answer
Here is the latest crash stack information.
iPhone 13 Pro Max
15.3.1
0 CoreFoundation _CFGetTypeID + 148
1 ImageIO _CGImageSourceCopyPropertiesAtIndex + 164
2 ImageIO _CGImageSourceCopyPropertiesAtIndex + 164
3 UIKitCore __UIImageGetOrientationAndScale + 68
4 UIKitCore _ImageSourceAtPath + 332
5 UIKitCore __UIImageSourceAtPath + 316
6 UIKitCore -[UIImage initWithContentsOfFile:cache:] + 72
7 UIKitCore +[UIImage imageWithContentsOfFile:] + 60
8 sohunews +[UIImage(themeImage) readImageFromDisk:context:] (SNThemeManager.m:0)
9 sohunews +[UIImage(themeImage) snImageNamed:] (SNThemeManager.m:0)
10 sohunews -[SNRollingNewsVideoCell addFlameAnimationImage] (SNRollingNewsVideoCell.m:0)
11 sohunews -[SNRollingNewsVideoCell initflameAnimation] (SNRollingNewsVideoCell.m:1082)
12 sohunews -[SNRollingNewsVideoCell initWithStyle:reuseIdentifier:] (SNRollingNewsVideoCell.m:169)
13 sohunews -[SNNewsPageTableDataSource tableView:cellForRowAtIndexPath:] (SNNewsPageTableDataSource.m:635)
14 UIKitCore -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1536
17 UIKitCore -[UITableView _visibleCellsUsingPresentationValues:] + 452
18 sohunews -[SNNormalChannelView handleTimer:] (SNNormalChannelView.m:0)
19 sohunews -[SNNormalChannelView viewDidAppear:] (SNNormalChannelView.m:1231)
20 sohunews -[SNNewsPageView collectionView:willDisplayCell:forItemAtIndexPath:] (SNNewsPageView.m:315)
21 UIKitCore -[UICollectionView _notifyWillDisplayCellIfNeeded:forIndexPath:] + 160
27 UIKitCore -[UIView(Hierarchy) layoutBelowIfNeeded] + 552
28 sohunews -[SNRollingNewsViewController reloadData] (SNRollingNewsViewController.m:0)
29 sohunews -[SNRollingNewsViewController updateChannels:] (SNRollingNewsViewController.m:2284)
30 CoreFoundation ___CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28
31 CoreFoundation ____CFXRegistrationPost_block_invoke + 52
32 CoreFoundation __CFXRegistrationPost + 456
33 CoreFoundation __CFXNotificationPost + 716
34 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 96
35 sohunews +[SNNotificationManager postNotificationName:object:] (SNNotificationManager.m:0)
36 sohunews __28-[SNChannelModel doRequest:]_block_invoke (SNChannelModel.m:0)
37 sohunews -[SNRequestManager requestSucceeded:responseObject:] (SNRequestManager.m:0)
38 sohunews __124-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:headers:uploadProgress:downloadProgress:success:failure:]_block_invoke_2 (AFHTTPSessionManager.m:290)
39 sohunews __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.108 (AFURLSessionManager.m:238)
40 libdispatch.dylib __dispatch_call_block_and_release + 32
41 libdispatch.dylib __dispatch_client_callout + 20
42 libdispatch.dylib __dispatch_main_queue_callback_4CF + 1036
43 CoreFoundation ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
44 CoreFoundation ___CFRunLoopRun + 2540
45 CoreFoundation _CFRunLoopRunSpecific + 600
46 GraphicsServices _GSEventRunModal + 164
47 UIKitCore -[UIApplication _run] + 1100
48 UIKitCore _UIApplicationMain + 364
49 sohunews main (main.m:15)
50 ??? 0x0000000104488000 + 0
I hope to hear from yours soon!
Best wishes!
Hi
Yesterday I was finishing a project on Objc, and then found a code organization style, and then responsible for this style of colleague B found me and said he kind of thing specification writing, I recommend this kind of not official, for the code neatness and readability requirements, I came here to seek an answer, although this problem does not affect the logic of the code, I still want a standard answer. But I still want a standard answer, before I have searched and asked a lot of people are recommended to write my way, and finally colleagues B also said that I may have problems with this way of writing, so I missed any details?
Colleague B's recommended writing style
#pragma mark -
#pragma mark Initialization
My recommended writing style
#pragma mark - Initialization
Best wishes!