Post

Replies

Boosts

Views

Activity

Cloudkit Request Per Second
Hi everyonea little doubtI am developing a small app, i have it in testflight and sent to a small amount of users, lets say 20 more or less.I have tried to oversimplify the connection rate of the app to cloudkit in order to have the smallest amount of connection per second. Nevertheless in cloudkit dashboard i have seen a spike of 3.5 request per seconds. It's small, but considered that i have only 20 test users at the moment i am very perplexedThe application will have a future audience of 1000-2000 users (based on poll) so the limit should stay at 40 request per second in the free tier.But if with only 20 test user i see spikes of 3.5 i suppose that i could see spikes of 150-200 request per seconds that means i will get((200-40)/10)*100 dollars to pay monthly... am i correct?Is this the case OR apple consider the request per seconds during the entire month?I mean 40 request per seconds would mean 3.456.000 request per day which means 100.000.000 request (+-) during the month (30 days)So am i safe until i reach that amount of request during the month and only after that the extra fee will be calculated?I am a real small developer so this information for me is vital and the documentation about is really not clear at all.Please someone, maybe from apple itself, help me understand
8
1
3.5k
Feb ’19
Memory problem on Xcode 13 and 13.1
I experienced a frustrating problem today wither with Xcode 13 and Xcode 13.1 rc that I have downloaded to test if the problem was presente also in the new version With a certain file Xcode sourcekitservice daemon went to a staggering 60-70 gb of memory causing the MacBook Pro m1 to freeze after a memory warning. After some investigation I found a weird problem (already signaled to apple bug reporting) with GeometryReader and frame. ////// //////  SwiftUIView.swift //////  ArteIncisa Evolution ////// //////  Created by Lorenzo Malaguti on 16/06/21. //////  Copyright © 2021 Nas-Tech. All rights reserved. ////// //// import SwiftUI // struct BugTitolo: View {     @State var title:String     var body: some View {         Text(title)             //.font(.custom("INCIMAR Latino 221D1 v.3.0", size: 30))             .foregroundColor(.white)             .shadow(color: .black, radius: 2, x: /*@START_MENU_TOKEN@*/0.0/*@END_MENU_TOKEN@*/, y: /*@START_MENU_TOKEN@*/0.0/*@END_MENU_TOKEN@*/)             .padding(.horizontal, 25)             .modifier(containerRow(backTexture: "ardesia"))     } } struct BugView: View {     @Binding var isPresented:Bool     @State var cfg_Account:Bool = false     @State var cfg_Elements:Bool = false //     let btnHeight:CGFloat = 50     let btnWidthMultiplier = 0.47          func GetColumnWitdh(screenwidth:CGFloat)->CGFloat     {         return screenwidth*btnWidthMultiplier     }          var body: some View {         GeometryReader{geom in             ZStack{                 Image("back.003")                     .resizable()                     .blur(radius: 3)                     .edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)                                  VStack{                     NavigationLink("account",                                    destination: cfgAccountView(isPresented: $cfg_Account),                                    isActive: $cfg_Account)                     NavigationLink("account",                                    destination: cfgElementiView(isPresented: $cfg_Elements),                                    isActive: $cfg_Elements)                 }                 .hidden()                                  // pulsante di ritorno e testo titolo-----------------------                 VStack{                     HStack{                         Button(action:  {                             isPresented=false                         }, label: {                             Image(systemName: "chevron.backward.circle")                                 .resizable()                                 .modifier(iconModifier())                         })                         Spacer()                         //Text( "Configurazione Arte Incisa")                         BugTitolo(title: "Configurazione Arte Incisa")                         Spacer()                     }                     // pulsante di ritorno e testo titolo-----------------------                     Spacer()                     HStack{                         VStack{                             Button(action: {                             }, label: {                                 Text("Account Utente")                                     .foregroundColor(Color.black)                                                                  // ***** THIS LINE DOES NOT GENERATE THE MEMORY OVERFLOW                                     .frame(width: geom.size.width*0.47, height: btnHeight, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)                                                                      // ***** IF YOU COMMENT THE PREVIOUS LINE AND UNCOMMENT THIS ONE A MEMORY PROBLEM WILL ARISE                                 //.frame(width: geom.size.width*btnWidthMultiplier, height: btnHeight, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)                                                                  // ***** IF YOU COMMENT THE PREVIOUS LINE AND UNCOMMENT THIS ONE THERE WILL BE NO PROBLEM                                 //.frame(width: GetColumnWitdh(screenwidth: geom.size.width), height: btnHeight, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)                                     .contentShape(Rectangle())                             })                         }                     }                 }                 .navigationBarTitle("", displayMode:.inline)                 .navigationBarBackButtonHidden(true)                 .navigationBarHidden(true)                 .navigationViewStyle(.stack)                                               }         }              } } @available(iOS 15.0, *) struct BugView_Previews: PreviewProvider {     static var previews: some View {         Group{                 NavigationView{                     BugView(isPresented: .constant(true))                 }                 .navigationViewStyle(.stack)             .previewDevice("iPad Pro (9.7-inch)")             .previewInterfaceOrientation(.landscapeLeft)         }     } } you will see in this code three .frame commands. if you comment and uncomment these leaving only one active you will see that sourcekitservice will grow exponentially (beware, you could be obliged to restart your Mac by keeping pressed the power button) This behavior is really strange, and based on how you do the multiplication the system became unstable. Does it happen also to other? Could you try to load this in Xcode and test it?
2
0
790
Oct ’21
Gesture: System gesture gate timed out.
Hi everyone I am fighting with a weird problem in my app I use swiftui and ai do not use tabs, but a hierarchy of view created by me that switch one to the other with a slide animation when I tap one of the elements i don't use gesture, but only ontap. The same app launched on two different iPhone has two different behaviours on the iPhone 11 no problem, the animation is fluid and responsive, on the iPhone 10 I got some delay, and in the console I can read Gesture: System gesture gate timed out I have searched but I have not found anything useful and more than this it is extremely difficult to find some info about this warning/error How can I solve this? on the iPhone 10 it seems like the animation got stuck for 1 seconds prior to be executed in the correct way
14
16
8.2k
May ’23
Core Data sharing with other users
Hi everyone i have an app that has some related entities. throught the different type of tutorial i see that apple incourages to use relationship and inverse relationship in the core data model, and that what i have done. Now, when i reach the point that a user wants to share one particular entity to other users, the inverse relationship spread the share to all the graph of core database shouldn't the inverse relationship be ignored by the share process? if i want to share only that record and the child, not the parent one, should i break the realtionship with the parent (that for me is the inverse relationship) imposing it to a nil value?
0
0
956
Jun ’23
Weird Coredata error
Hi I really don't understand. I have a record type on CloudKit where I store some data and a corresponding entity on core data that I sync with CloudKit with a very basic routine at some point I call this func: func GetUserFromCoredata(userID:String)->UserEntity? { var fetched:[UserEntity]?=nil let fetch = NSFetchRequest<UserEntity>(entityName:"UserEntity") let predicate = NSPredicate(format:"TRUEPREDICATE") fetch.predicate = predicate fetch.affectedStores = [DBGlobals.localStore, DBGlobals.cloudStore] do{ print("RICHIESTA FETCH UTENTI IN COREDATA") fetched = try context.fetch(fetch) } catch{ fatalError("errore nel recupero dell'elenco utenti") } if let found = fetched { for el in found { if el.userID == userID { return el } } } return nil } As you can see nothing special. it is only a fetch made on two stores. If I run the code 20 times 19 are good and 1 result in a fatal error with this text: 2023-06-28 17:56:49.684780+0200 xDeskApp[23313:2379150] -[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x215632f50 2023-06-28 17:56:49.712724+0200 xDeskApp[23313:2379150] [error] error: SQLCore dispatchRequest: exception handling request: <NSSQLFetchRequestContext: 0x283d88000> , -[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x215632f50 with userInfo of (null) 2023-06-28 17:56:49.974635+0200 xDeskApp[23313:2379150] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x215632f50' *** First throw call stack: (0x1bd4d4cb4 0x1b657c3d0 0x1bd649ab8 0x1bd4eb0e8 0x1bd551900 0x1c4c53594 0x1c4bdf848 0x1c4bdf4b0 0x1c4c81d80 0x1068fa038 0x10690b814 0x1c4c81c20 0x1c4bcef68 0x1c4bcee38 0x1c4bbe200 0x1c4bc9a78 0x1c4d3752c 0x1c4c02678 0x1c4bc86d8 0x1c4bbb9fc 0x1c4bb6b14 0x1c4cc97ec 0x104bf00b0 0x104bef860 0x104bee8f4 0x1c4f82ce8 0x1c4f82d8c 0x1c5068cac 0x1c4f1f3b0 0x1c4f11338 0x1c50689d4 0x1bd53dc04 0x1bd4ebcb4 0x1bd4eb6cc 0x1c4fcc800 0x10690b158 0x1068fa038 0x1069020b0 0x106902e28 0x10690fc74 0x21d250ddc 0x21d250b7c) libc++abi: terminating due to uncaught exception of type NSException (Recorded stack frame) ... and really, I can't understand. the predicate is absolutely basic, the entity exist, here I am not syncing anything, just fetching the records in the two stores... what am I doing wrong? why 19 su 20 are good and one is catching this error?
2
0
875
Jun ’23
Xcode preview crash continuously
Hi. Just update my MacBook Pro M1 with sequoia and Xcode and I got huge problem with preview on simply swiftui pages. This is the full report I got when the preview crash but if I run the app on the device or the simulator it works fine. How can I solve this situation? the crashing thread is number 6 which reports this: Thread 6 Crashed:: Dispatch queue: com.apple.root.user-initiated-qos 0 XOJIT 0x240b899f8 llvm::Error llvm::detail::UniqueFunctionBase<llvm::Error, llvm::jitlink::LinkGraph&>::CallImpl<xojit::ReplacementManager::Plugin::modifyPassConfig(llvm::orc::MaterializationResponsibility&, llvm::jitlink::LinkGraph&, llvm::jitlink::PassConfiguration&)::'lambda'(llvm::jitlink::LinkGraph&)>(void*, llvm::jitlink::LinkGraph&) + 1784 1 XOJIT 0x240c1b46c llvm::jitlink::JITLinkerBase::runPasses(std::__1::vector<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>, std::__1::allocator<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>>>&) + 76 2 XOJIT 0x240c1ab68 llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase, std::__1::default_delete<llvm::jitlink::JITLinkerBase>>) + 72 3 XOJIT 0x240c2158c llvm::jitlink::link_MachO_arm64(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 3608 4 XOJIT 0x240c20400 llvm::jitlink::link_MachO(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 72 5 XOJIT 0x240c19cc8 llvm::jitlink::link(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 80 6 XOJIT 0x240c0acc0 llvm::orc::ObjectLinkingLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>) + 256 7 XOJIT 0x240bfcbfc llvm::orc::BasicObjectLayerMaterializationUnit::materialize(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>) + 60 8 XOJIT 0x240be3f08 llvm::orc::MaterializationTask::run() + 44 9 XOJIT 0x240b97e1c invocation function for block in (anonymous namespace)::GCDTaskDispatcher::dispatch(std::__1::unique_ptr<llvm::orc::Task, std::__1::default_delete<llvm::orc::Task>>) + 108 10 libdispatch.dylib 0x1801774ec _dispatch_call_block_and_release + 24 11 libdispatch.dylib 0x180178de0 _dispatch_client_callout + 16 12 libdispatch.dylib 0x18018b864 _dispatch_root_queue_drain + 1208 13 libdispatch.dylib 0x18018bf60 _dispatch_worker_thread2 + 232 14 libsystem_pthread.dylib 0x104db7b38 _pthread_wqthread + 224 15 libsystem_pthread.dylib 0x104db6934 start_wqthread + 8 Full Report
4
5
1.1k
Sep ’24