Welcome to the Apple Developer Forums

Post your questions, exchange knowledge, and connect with fellow developers and Apple engineers on a variety of software development topics.

For questions about using Apple hardware and services, visit Apple Support Communities

Posts

Sort by:
Post not yet marked as solved
0 Replies
2 Views
Let’s say I have a hundred of big files to upload to a server, using requests with a short-lived authorisation token. NSURLSession background upload describes a problem with adding too many requests, so the first question is: should we manage uploads manually, by which I mean queuing, postponing, retrying. Will we then fall into the same traps only in a different way? What to do if tasks picked by the system have outdated token, and so fail. How to update a token: is there a delegate method (preferable pre iOS 13 compatibile) in which I can get a fresh token and modify a request header? Is there any iOS specific design pattern or contract (Apple's list of server requirements) that would allow uploads to be resumable?
Posted
by
Post not yet marked as solved
0 Replies
1 Views
The TextField in the following code makes the List very lag when scrolling. Note that I'm not even changing the property used by TextField. I'm able to solve this by changing my model to a ObservableObject but I would like to keep as a struct if possible. Does anyone have any solution? Thanks! struct Model: Identifiable {     let id = UUID()     var text: String = "Lorem Ipsum"     var bool = false } struct RowView: View {          @Binding var model: Model          var body: some View {         TextField("", text: $model.text)             .task {                 try? await Task.sleep(for: .seconds(0.5))                 model.bool.toggle()             }     }      } struct ContentView: View {          @State var models = (1...100).map({ _ in Model() })          var body: some View {         List {             ForEach($models) { $model in                 RowView(model: $model)             }         }     } }
Posted
by
Post not yet marked as solved
0 Replies
10 Views
We noticed that sometimes exec messages delivered by Endpoint Security contain unexpected data since Ventura: When a script is executed by a shell, like zsh, the process data for the responsible and the target process are identical, including the pidversion - but only sporadically. At first, I thought that it might be the case that pidversions are not incremented when a process execs into the same image. But my tests showed that this is not the case, and the pidversion is incremented in any case. I also tried to trigger this behavior with a program basically recursively execs into itself, but that worked as expected. So far, I've only observed this behavior with shell scripts. Here is an example: (lldb) p *(msg->process) (es_process_t) $7 = { audit_token = { val = ([0] = 4294967295, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 12196, [6] = 100873, [7] = 29277) } ppid = 10691 original_ppid = 10691 group_id = 10691 session_id = 10691 codesigning_flags = 570493697 is_platform_binary = true is_es_client = false cdhash = "\U00000017\x8e$Y\xd0Z\x90\x8f\x92S\xc3s\xff<\x9c\xd6\xe2a\U00000011V" signing_id = (length = 13, data = "com.apple.zsh") team_id = (length = 0, data = 0x0000000000000000) executable = 0x00000001036bb1e8 tty = nullptr start_time = (tv_sec = 1669896286, tv_usec = 191693) responsible_audit_token = { val = ([0] = 501, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 10682, [6] = 100349, [7] = 24944) } parent_audit_token = { val = ([0] = 4294967295, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 10691, [6] = 100873, [7] = 24963) } } (lldb) p *(msg->event.exec.target) (es_process_t) $8 = { audit_token = { val = ([0] = 4294967295, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 12196, [6] = 100873, [7] = 29277) } ppid = 10691 original_ppid = 10691 group_id = 10691 session_id = 10691 codesigning_flags = 570493697 is_platform_binary = true is_es_client = false cdhash = "\U00000017\x8e$Y\xd0Z\x90\x8f\x92S\xc3s\xff<\x9c\xd6\xe2a\U00000011V" signing_id = (length = 13, data = "com.apple.zsh") team_id = (length = 0, data = 0x0000000000000000) executable = 0x00000001036bba00 tty = nullptr start_time = (tv_sec = 1669896286, tv_usec = 191693) responsible_audit_token = { val = ([0] = 501, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 10682, [6] = 100349, [7] = 24944) } parent_audit_token = { val = ([0] = 4294967295, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 10691, [6] = 100873, [7] = 24963) } } Is this an error in Endpoint Security, or am I missing something here? Steps to reproduce execute a script repeatedly to trigger the behavior, e.g. for i in {1..200000}; do ./script1.sh > /dev/null; # sleep 1; still happens, but you have to wait longer done in another terminal you can use eslogger like this sudo eslogger exec | jq 'if .process.audit_token.pidversion == .event.exec.target.audit_token.pidversion then "\(input_line_number) pidversion did not change: \(.process.audit_token.pidversion == .event.exec.target.audit_token.pidversion) \(.process.executable.path) -> \(.event.exec.target.executable.path)" else empty end' which could output something like this: "3211638 pidversion did not change: true /bin/zsh -> /bin/zsh"
Posted
by
Post not yet marked as solved
0 Replies
11 Views
I create a new process for the drag n drop to swap Cell. it's working but I would like to create a background at the initial Cell after moving it, instead of blank cell. Thanx for your response
Posted
by
Post not yet marked as solved
0 Replies
22 Views
Hello, I have a monthly subscription with a 1 year introductory offer. When I don't make any changes to the regular monthly price, but increase the price for the introductory offer, then existing subscribers will NOT be notified in any way, is that correct? Only if I would increase the price of the regular monthly subscription then existing subscribers will be notified before the 1 year introductory offer is over and the regular monthly subscription starts, is that right? Thank you!
Posted
by
Post not yet marked as solved
1 Replies
22 Views
I want to have a property in a struct/class where it is of type custom View e.g. var view: some View? So many issues here, I ended up doing var view: AnyView? But i got stuck here because whenever I assign a value to this, the app crashes. saying Could not cast value of type '__NSCFNumber' (0x7fdcdf9c3480) to 'NSString' (0x1192bac50). This i do not understand view should be some view so it si neither number nor string. any idea why? also. if i do this var view: (some View)? it is ok. but when i set a value to that property it says Cannot assign value of type 'DailyCityReportView' to type 'some View' My goal is to pass a custom view to a property.
Posted
by
Post not yet marked as solved
0 Replies
26 Views
i am creating call recording app in which i want when i call someone or someone call me then a popup appear that tells user to merge call to record ? if user click on yes then it will redirect to my app and record call.... how can i achieve this in swift ? i searched on internet but didn't find relevant material to do this task...
Posted
by
Post not yet marked as solved
0 Replies
21 Views
'- (void)loadProductWithParameters:(NSDictionary<NSString *,id> *)parameters impression:(SKAdImpression *)impression completionBlock:(void (^)(BOOL result, NSError *error))block;' From the apple's document, iOS 16.1+ & SKAN 4.0, it seems that we need to create a SKAdImpression with SKStoreProductParameterAdNetworkSourceIdentifier, then use this impression instance to create a SKStoreProductViewController. However, my questions are Can we use old API [*** loadProductWithParameters: @{SKStoreProductParameterAdNetworkSourceIdentifier: xxxx, ...} completion:block]; to make SKAN 4.0 take effect? If no, how can we implement App Store preload + SKAN 4.0? In our existing business, we try to load product before the ads' impression, when user click some button, we present the preload SKStoreProductViewController.
Posted
by
Post not yet marked as solved
1 Replies
25 Views
I'm working on my capstone project, and I need to add variables from a view to a dictionary (possibly located outside the view) so that I can be able to access the dictionary in other views. How do I go about it?
Posted
by
Post not yet marked as solved
0 Replies
25 Views
i have coredata and i want to add bool Optional but i get error: import CoreData @objc(HistoryData) class HistoryData: NSManagedObject {       @NSManaged var firstName: String   @NSManaged var lastName: String   @NSManaged var telephone: String   @NSManaged var time: String   @NSManaged var callHidden: Bool? // Here the error } Error: Property cannot be marked @NSManaged because its type cannot be represented in Objective-C in xcdatamodeld it selected Optional but it not do it.. why?
Posted
by
Post not yet marked as solved
0 Replies
26 Views
Hey everyone, I have a fintech app based of India where we let people pay for their credit bills (credit cards, loan etc.) on the app and in return we give them back rewards that can be redeemed on our app as vouchers. Repeatedly Apple is rejecting our app. The latest reason for the rejections is: Guideline 3.2.2 - Business - Other Business Model Issues Unacceptable The primary purpose of your app is to encourage users to watch ads or perform marketing-oriented tasks, which is not appropriate for the App Store. Now, We don't have any ads or any marketing oriented tasks. We do have integration with marketing tech providers like Appsflyer and Moengage. How do we go about it? Help would be much appricated. R, VM
Posted
by
Post not yet marked as solved
1 Replies
29 Views
Hi, My requirement is that I want to get a list of all IP addresses associated with all network interfaces on these Apple platforms - iOS, iPadOS, tvOS, watchOS. One of the approaches which will work for all the platforms is using getifaddrs API. I want to know whether there exists a native approach in either Swift or Objective-C which solves this problem. Official Apple documentation for getifaddrs API is kept in the archive section. Therefore, I am not sure whether it is a good approach to go ahead with or not. And I want to write the code in High-Level language as far as possible. So want to avoid using getifaddrs API directly as far as possible. I went through the classes/structs such as NWInterface, NWPath, NWPathMonitor. But was not able to figure out any API which will serve my purpose.
Posted
by
Post not yet marked as solved
1 Replies
27 Views
Running a MacOS Intel app from XCode 14.1, trying to access the user’s home folders, in this case, the ~/Downloads folder. I get directoryEnumerator error at file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/: Error Domain=NSCocoaErrorDomain Code=256 "The file “Downloads” couldn’t be opened." UserInfo={NSURL=file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/, NSFilePath=/Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads, NSUnderlyingError=0x6000011b2880 {Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"}} If I cd to this location, I do get access to the ~/Downloads folder, so the error is not telling the truth. Here is my entitlements plist &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; &lt;plist version="1.0"&gt; &lt;dict&gt; &lt;key&gt;com.apple.security.app-sandbox&lt;/key&gt; &lt;true/&gt; &lt;key&gt;com.apple.security.files.downloads.read-only&lt;/key&gt; &lt;true/&gt; &lt;key&gt;com.apple.security.temporary-exception.files.home-relative-path.read-only&lt;/key&gt; &lt;array&gt; &lt;string&gt;/Documents/&lt;/string&gt; &lt;string&gt;/Desktop/&lt;/string&gt; &lt;/array&gt; &lt;key&gt;com.apple.security.files.user-selected.read-only&lt;/key&gt; &lt;true/&gt; &lt;/dict&gt; &lt;/plist&gt; By the way, I don’t get prompted to grant access to the app and that seems suspicious.
Posted
by
Post not yet marked as solved
0 Replies
27 Views
I downloaded an app about PacketTunnelProvider from github, and changed the bundleid of the app. The program can run and the function is easy to use. But when I deleted the target of the PacketTunnel and tried to create a new target of the PacketTunnel myself, I found that the code was not executed, and the bundleid ID was still used, which was applied from the developer center. I use xcode 13.2.1. I want to ask you to tell me why the new target is difficult to use, but the original one is. I guarantee that the bundleid is available. I've tried many times, but I can't realize it. What configurations are missing
Posted
by
Post not yet marked as solved
0 Replies
29 Views
I am building react native project using fastlane , on my own mac it is working properly. but when i send those cmd from a Jenkins server to my mac via SSH i got quite a lot of problems related to user rights after ssh with keychain, yes i fixed it with following cmd. security -v unlock-keychain -p "password" /Users/apple/Library/Keychains/login.keychain i passed the keychains error but achive error [31m❌ error: Failed with exit code exited with status 1 (in target 'App' from project 'App') [0m ** ARCHIVE FAILED ** The following build commands failed: CopySwiftLibs /Users/apple/Library/Developer/Xcode/DerivedData/App-caccyswepcwwvwfduugmcacqjtby/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app (in target 'App' from project 'App') (1 failure) [15:15:52]: [31mExit status: 65 [0m i am building react native project using fastlane , on my own mac it is working properly. but when i send those cmd from a Jenkins server to my mac via SSH i got quite a lot of problems related to user rights after ssh with keychain, yes i fixed it with following cmd. security -v unlock-keychain -p "password" /Users/apple/Library/Keychains/login.keychain i passed the keychains error but achive error [31m❌ error: Failed with exit code exited with status 1 (in target 'App' from project 'App') [0m ** ARCHIVE FAILED ** The following build commands failed: CopySwiftLibs /Users/apple/Library/Developer/Xcode/DerivedData/App-caccyswepcwwvwfduugmcacqjtby/Build/Intermediates.noindex/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/App.app (in target 'App' from project 'App') (1 failure) [15:15:52]: [31mExit status: 65 [0m here is the cmd that i ran. security -v unlock-keychain -p "pasword" /Users/apple/Library/Keychains/login.keychain fastlane build
Posted
by

Pinned Posts

Categories

See all