Search results for

“SwiftData inheritance relationship”

4,982 results found

Post

Replies

Boosts

Views

Activity

Where is the App Icons section for an action extension in 8.6?
Action Extensions do not inherit the icon from their containing app unlike the other extensions. And I've been puzzling for weeks trying to figure out how to add one (adding an app icon image set in the extension's assets catalog does not work).Then I found a tutorial (http://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794)The tutorial says As a finishing touch, you can add an icon for the Action extension. In the Project Navigator, select the project and, under targets, select the ReadItAction target. From the General tab in the App Icons and Launch Images section, tap Use Asset Catalog next to the App Icons Source.But an Action Extension DOES NOT have an App Icons and Launch Images section, at least not in XCode v8. So how can the icon be added for an action extension?
3
0
2.0k
Aug ’16
Reply to Too much churn from Beta to Beta!
Quinn, if this feedback is above your pay grade then you need a raise and a promotion, because you've been around long enough to have more influence than that on a team as important as the Swift team.For the expected quality of software in a third-generation project in late Beta, Swift 3 has become a trainwreck of Microsoftian proportions--at least in terms of process and expectation. Many of us devs are spending 90% of our time not developing our app, but babysitting Swift and trying to understand so many unvetted changes. That's fine if you're working on salary but for many of us, time is money.This is made all the more difficult by not having a stable language spec, adequate documentation, code samples or working look-ups in Xcode for two years now. We're being treated like lab monkeys during late Beta as I said above. As others have said, it feels like we're developing in quicksand. The lack of attention to glaring bugs in the editor and the tool chain is deeply concerning.I can't even build without segme
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’16
How to Add target NSManagedObject to another one with an inverse many-to-many Core Data relationship without duplicating target NSManagedObject?
Hi everyone: I had encountered an issue one of my projects, I had spent dozen of hours to find the solution, I had made some progress, but still not getting what I would like to achieve ideally. I am still finding solutions myself now, while I would really appreciate anyone could share any insight for constructive solutions.Issue:How to add a target NSManagedObject from a master list as one object of the references in another NSManagedObject with an inverse many-to-many relationship between each NSManagedObject without creating duplicate target NSManagedObject in the master list.Note:The following example used an analogy to the full data model graphs to my real project. The analogy is what I can best describe the issue I have, while the objects in the analogy do not fully share the same name of the objects in the real project.What I have now:A master list of ingredient objects, which are unique among each other.A list of recipe objects, each of which would like to have different ingredient objects to
1
0
668
Aug ’16
Reply to How to Add target NSManagedObject to another one with an inverse many-to-many Core Data relationship without duplicating target NSManagedObject?
Solution:The same issue had been posted at stack overflow, and here is the discussion and solution of it.http://stackoverflow.com/questions/39016828/how-to-add-target-nsmanagedobject-to-another-one-with-an-inverse-many-to-many-coGenerally, the project needs to create an intermediate (join) entity to keep track of the relationships between recipe and ingredients objects, which follows the guide in Modeling a Relationship Based on Its Semantics section of the document Core Data Programming Guide - Creating Managed Object Relationships:https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/HowManagedObjectsarerelated.html#//apple_ref/doc/uid/TP40001075-CH17-SW1Thank you.
Aug ’16
Incorrect configuration name on first launch from NSPersistentContainer
I'm wondering if this is an issue with the NSPersistentContainer or something else is going on but when I launch the new model for my app and try to save a new relationship to an object it fails.Unresolved error Error Domain=NSCocoaErrorDomain Code=134020 The model configuration used to open the store is incompatible with the one that was used to create the store.NSUnderlyingException=Can't resolve how to assign objects to stores; some objects may have been assigned to stores; use [[managedObject objectID] persistentStore] to find out what is going where nowThis only happens on the first launch and I can see why. The configuration name is reported as PF_DEFAULT_CONFIGURATION_NAME rather than Users as it should be. Once the app is relaunched all works fine and the configuration reports correctly from launch.
1
0
1.4k
Aug ’16
Reply to store custom metadata or flag at PHAsset level?
No, I don't think so. What worked reasonably well for us, though, is to use the PHAsset's localIdentifier Property (inherited from PHObject) to look up custom metadata objects that we previously stored in a CoreData-backed dictionary (upon creating the asset). On top of that, we used PHPhotoLibraryChangeObserver to keep the stored metadata in sync with the photo library.
Aug ’16
Reply to Strange behavior with NSURLSession and ATS on macOS
With further debugging, we found that clearing the Safari browsing history fixes the problem.Yeah, this is one of the reasons I was asking about sandboxing and redirects. In a non-sandboxed Mac app, NSURL{Session,Connection} share a lot of state with Safari. This is inherited from the original NSURLConnection architecture, where such state sharing was a desired behaviour (oh how the world has changed since 2002!).If you sandbox your Mac app then all of that state sharing gets disabled.Some of that state sharing—namely the three standard state holders, NSHTTPCookieStorage, NSURLCredentialStorage, and NSURLCache—can be disabled via the NSURLSessionConfiguration, but I’m not sure if that covers all the cases.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Privacy & Security SubTopic: General Tags:
Aug ’16
Base UIViewController implements UITableViewDelegate and child view controller as well causing an Exception
Hey guys,I have created a base UIViewController in my app which contains some shared functionality between other child controllers. The problem is that my base view controller implements the UITableViewDelegate and UITableViewDataSource, so if any of the child view controllers implements the same UITableViewDelegate and UITableViewDataSource raises an exception saying that I can't self as a subview of self. I have tried different possible solutions and discover that the issue is actually the fact of having two table view. One is being inherited from the base controller and the other is in the child controller as soon as I remove the child controller table view everything works fine.Also, I'm doing the layout in Storyboards. 😟 Any ideas?Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
1.6k
Aug ’16
Reply to legalities
You didn't mention which platform(s) or even how you plan to distribute your apps.For Mac apps, you can distribute them either via the app store or from your own website.For iOS/TvOS/WatchOS you can only distribute them in-house to staff/employees if you're an enterprise developer member orvia the app store as an individual or company developer. You cannot distribute these apps via your own website.Contracts? With whom? If you mean you intend to develop apps for hire, then you need to consult an attorney and have themdraw up the proper contract types for the work/relationship you'll be working with. If you mean to distribute apps on either theMac or iOS/TvOS stores, you need to be a paid member of the Apple Developer program and sign the contracts Apple providesfor that purpose.Taxes again will depend on what you plan on doing and where your apps will be sold. Apple manages a lot of the sales/vat etc sortsof stuff but, in some cases you have to also pay country specific taxes/fees depending on where
Aug ’16
Reply to Core Data Modelling
If you've done work in PHP and SQL, then I wonder if you learned the wrong lesson as far as composing data structures that are searchable. 😐 Because I assume that's the part where you're getting stuck modeling your game data structure.The basic rules of Core Data modeling are:0. Never assume your data fits in memory. If your data fits in memory (or you don't care), Core Data is overkill and you're wasting development time.1. Only Core Data entities can reference other Core Data entities. They must do this using relationships.2. Non-Core Data objects (including collections such as dictionaries) cannot reference Core Data entities directly.The first rule is part of the nature of the system. The second rule you can try to fight, but if you try to fight it you punish yourself and work against the design of the system. If you're new to Core Data and you find yourself violating the second rule, you're using the wrong approach.Your game time dictionary violates rule #2, and partially violates rule 0.One of
Aug ’16
Reply to Can't create physics bodies inside initWithCoder
The point about archiving is that objects might get unarchived before relationships between them (in particular, parent-child relationships) are re-established. In addition, the parts of Xcode that handle UI design are getting smarter at making custom class behavior available at design time, so Xcode itself might have invoked your initializer when you initially added your parent objects.On reflection, this doesn't sound especially likely, but I was trying to direct your attention to the actual initialization sequence, to see if you watch things go wrong. You have to be especially diligent if you have any reason to suspect that the instance that ends up being the child node is not the same instance you created in onInit.If it is, then the next step would to try to watch the physics body property get set back to nil. If you can see it as non-nil at line 9 of your original code fragment, but see it as nil later, you should be able to set a symbolic breakpoint on the setPhysicsBody method to fin
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Aug ’16
Initialize & whole module optimization
Sort of an odd problem. I have an app and a framework. Both projects are about 95% swift. ( some exceptions like sqlite config which wanted var args in c ... Swift did not like that ) In debug mode, the program runs as expected. Things are moving along positively and I decided it was time to try some optimizations out. eg. Make classes final and turn on whole module optimization -- optimize across files is my understanding.If I turn on whole module optimization on both the app and the framework, then the app crashes. An unexpected nil in a optional. If I only turn on whole module optimization on the frame work but leave the app fast optimization or debug, then the app does not crash.After some more investigation, it appears a class that inherits NSObject and overrides the initialize method was not called. Turns out the particular class only has class methods and initializes a static properties once. That is no instance methods. ( though it inherits instance methods from NSObject but I'm not
6
0
2.2k
Sep ’16
Reply to Initialize & whole module optimization
I suspect that none of the following will be news to you. If so, please post some cut down snippets of each of your approaches so that we can see the specific details.Oh, another useful tip in situations like this is to put a breakpoint on your +initialize method, run it in the working case, and look at the backtrace to see how you got initialised. After some more investigation, it appears a class that inherits NSObject and overrides the initialize method was not called.In the above, does “initialize method” mean the initialize() class method (or +initialize in Objective-C)? If so, you do have to be careful here because that method is only called when the class is actually used. For example, this tiny test program prints false unless you uncomment line A. import Foundation var gIsSetUp: Bool = false class Test : NSObject { override class func initialize() { gIsSetUp = true } } // print(Test.self) // line A print(gIsSetUp)For kicks, I got rid of the NSObject inheritance. Then I attempted to s
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’16
Reply to My iMessage isn't working. About 70% of my conversations cannot be opened, as the app crashes. Any ideas to fix it?
This happens consistently with the debbuger attached. The debugger doesn't stop and doesn't display any logs. The only logs that could be interesting (but maybe not reated to my iMessage extension) are:Failed to inherit CoreMedia permissions from 20417: (null) subsystem: com.apple.BackBoardServices.fence, category: Observer, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0 [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/patrickbalestra/Library/Developer/CoreSimulator/Devices/2A1F73AA-01C6-45E6-A085-2E1989D88267/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles [MC] Reading from private effective user settingsNo crash line, no exception, nothing 😟EDIT: I found the issue by trying reach line of my code. The line that was driving iOS crazy in viewDidAppear was:textView.becomeFirstResponder()I just wanted to automaticall
Topic: App & System Services SubTopic: General Tags:
Sep ’16
Where is the App Icons section for an action extension in 8.6?
Action Extensions do not inherit the icon from their containing app unlike the other extensions. And I've been puzzling for weeks trying to figure out how to add one (adding an app icon image set in the extension's assets catalog does not work).Then I found a tutorial (http://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794)The tutorial says As a finishing touch, you can add an icon for the Action extension. In the Project Navigator, select the project and, under targets, select the ReadItAction target. From the General tab in the App Icons and Launch Images section, tap Use Asset Catalog next to the App Icons Source.But an Action Extension DOES NOT have an App Icons and Launch Images section, at least not in XCode v8. So how can the icon be added for an action extension?
Replies
3
Boosts
0
Views
2.0k
Activity
Aug ’16
Reply to Too much churn from Beta to Beta!
Quinn, if this feedback is above your pay grade then you need a raise and a promotion, because you've been around long enough to have more influence than that on a team as important as the Swift team.For the expected quality of software in a third-generation project in late Beta, Swift 3 has become a trainwreck of Microsoftian proportions--at least in terms of process and expectation. Many of us devs are spending 90% of our time not developing our app, but babysitting Swift and trying to understand so many unvetted changes. That's fine if you're working on salary but for many of us, time is money.This is made all the more difficult by not having a stable language spec, adequate documentation, code samples or working look-ups in Xcode for two years now. We're being treated like lab monkeys during late Beta as I said above. As others have said, it feels like we're developing in quicksand. The lack of attention to glaring bugs in the editor and the tool chain is deeply concerning.I can't even build without segme
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’16
How to Add target NSManagedObject to another one with an inverse many-to-many Core Data relationship without duplicating target NSManagedObject?
Hi everyone: I had encountered an issue one of my projects, I had spent dozen of hours to find the solution, I had made some progress, but still not getting what I would like to achieve ideally. I am still finding solutions myself now, while I would really appreciate anyone could share any insight for constructive solutions.Issue:How to add a target NSManagedObject from a master list as one object of the references in another NSManagedObject with an inverse many-to-many relationship between each NSManagedObject without creating duplicate target NSManagedObject in the master list.Note:The following example used an analogy to the full data model graphs to my real project. The analogy is what I can best describe the issue I have, while the objects in the analogy do not fully share the same name of the objects in the real project.What I have now:A master list of ingredient objects, which are unique among each other.A list of recipe objects, each of which would like to have different ingredient objects to
Replies
1
Boosts
0
Views
668
Activity
Aug ’16
Reply to How to Add target NSManagedObject to another one with an inverse many-to-many Core Data relationship without duplicating target NSManagedObject?
Solution:The same issue had been posted at stack overflow, and here is the discussion and solution of it.http://stackoverflow.com/questions/39016828/how-to-add-target-nsmanagedobject-to-another-one-with-an-inverse-many-to-many-coGenerally, the project needs to create an intermediate (join) entity to keep track of the relationships between recipe and ingredients objects, which follows the guide in Modeling a Relationship Based on Its Semantics section of the document Core Data Programming Guide - Creating Managed Object Relationships:https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/HowManagedObjectsarerelated.html#//apple_ref/doc/uid/TP40001075-CH17-SW1Thank you.
Replies
Boosts
Views
Activity
Aug ’16
Incorrect configuration name on first launch from NSPersistentContainer
I'm wondering if this is an issue with the NSPersistentContainer or something else is going on but when I launch the new model for my app and try to save a new relationship to an object it fails.Unresolved error Error Domain=NSCocoaErrorDomain Code=134020 The model configuration used to open the store is incompatible with the one that was used to create the store.NSUnderlyingException=Can't resolve how to assign objects to stores; some objects may have been assigned to stores; use [[managedObject objectID] persistentStore] to find out what is going where nowThis only happens on the first launch and I can see why. The configuration name is reported as PF_DEFAULT_CONFIGURATION_NAME rather than Users as it should be. Once the app is relaunched all works fine and the configuration reports correctly from launch.
Replies
1
Boosts
0
Views
1.4k
Activity
Aug ’16
Reply to store custom metadata or flag at PHAsset level?
No, I don't think so. What worked reasonably well for us, though, is to use the PHAsset's localIdentifier Property (inherited from PHObject) to look up custom metadata objects that we previously stored in a CoreData-backed dictionary (upon creating the asset). On top of that, we used PHPhotoLibraryChangeObserver to keep the stored metadata in sync with the photo library.
Replies
Boosts
Views
Activity
Aug ’16
Reply to Strange behavior with NSURLSession and ATS on macOS
With further debugging, we found that clearing the Safari browsing history fixes the problem.Yeah, this is one of the reasons I was asking about sandboxing and redirects. In a non-sandboxed Mac app, NSURL{Session,Connection} share a lot of state with Safari. This is inherited from the original NSURLConnection architecture, where such state sharing was a desired behaviour (oh how the world has changed since 2002!).If you sandbox your Mac app then all of that state sharing gets disabled.Some of that state sharing—namely the three standard state holders, NSHTTPCookieStorage, NSURLCredentialStorage, and NSURLCache—can be disabled via the NSURLSessionConfiguration, but I’m not sure if that covers all the cases.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’16
Base UIViewController implements UITableViewDelegate and child view controller as well causing an Exception
Hey guys,I have created a base UIViewController in my app which contains some shared functionality between other child controllers. The problem is that my base view controller implements the UITableViewDelegate and UITableViewDataSource, so if any of the child view controllers implements the same UITableViewDelegate and UITableViewDataSource raises an exception saying that I can't self as a subview of self. I have tried different possible solutions and discover that the issue is actually the fact of having two table view. One is being inherited from the base controller and the other is in the child controller as soon as I remove the child controller table view everything works fine.Also, I'm doing the layout in Storyboards. 😟 Any ideas?Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
3
Boosts
0
Views
1.6k
Activity
Aug ’16
swift 3 on XCode 8 bata 6 a protocol problem
I creat a custom framework. In the framework, I define a protocol and a class. The class realize the protocol, and in my application create a class inheritance that class in the framework. Run it ,The console output not find the protocol`s methodxcode 8 bata 5 have no the problem.
Replies
7
Boosts
0
Views
1.3k
Activity
Aug ’16
Reply to legalities
You didn't mention which platform(s) or even how you plan to distribute your apps.For Mac apps, you can distribute them either via the app store or from your own website.For iOS/TvOS/WatchOS you can only distribute them in-house to staff/employees if you're an enterprise developer member orvia the app store as an individual or company developer. You cannot distribute these apps via your own website.Contracts? With whom? If you mean you intend to develop apps for hire, then you need to consult an attorney and have themdraw up the proper contract types for the work/relationship you'll be working with. If you mean to distribute apps on either theMac or iOS/TvOS stores, you need to be a paid member of the Apple Developer program and sign the contracts Apple providesfor that purpose.Taxes again will depend on what you plan on doing and where your apps will be sold. Apple manages a lot of the sales/vat etc sortsof stuff but, in some cases you have to also pay country specific taxes/fees depending on where
Replies
Boosts
Views
Activity
Aug ’16
Reply to Core Data Modelling
If you've done work in PHP and SQL, then I wonder if you learned the wrong lesson as far as composing data structures that are searchable. 😐 Because I assume that's the part where you're getting stuck modeling your game data structure.The basic rules of Core Data modeling are:0. Never assume your data fits in memory. If your data fits in memory (or you don't care), Core Data is overkill and you're wasting development time.1. Only Core Data entities can reference other Core Data entities. They must do this using relationships.2. Non-Core Data objects (including collections such as dictionaries) cannot reference Core Data entities directly.The first rule is part of the nature of the system. The second rule you can try to fight, but if you try to fight it you punish yourself and work against the design of the system. If you're new to Core Data and you find yourself violating the second rule, you're using the wrong approach.Your game time dictionary violates rule #2, and partially violates rule 0.One of
Replies
Boosts
Views
Activity
Aug ’16
Reply to Can't create physics bodies inside initWithCoder
The point about archiving is that objects might get unarchived before relationships between them (in particular, parent-child relationships) are re-established. In addition, the parts of Xcode that handle UI design are getting smarter at making custom class behavior available at design time, so Xcode itself might have invoked your initializer when you initially added your parent objects.On reflection, this doesn't sound especially likely, but I was trying to direct your attention to the actual initialization sequence, to see if you watch things go wrong. You have to be especially diligent if you have any reason to suspect that the instance that ends up being the child node is not the same instance you created in onInit.If it is, then the next step would to try to watch the physics body property get set back to nil. If you can see it as non-nil at line 9 of your original code fragment, but see it as nil later, you should be able to set a symbolic breakpoint on the setPhysicsBody method to fin
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Aug ’16
Initialize & whole module optimization
Sort of an odd problem. I have an app and a framework. Both projects are about 95% swift. ( some exceptions like sqlite config which wanted var args in c ... Swift did not like that ) In debug mode, the program runs as expected. Things are moving along positively and I decided it was time to try some optimizations out. eg. Make classes final and turn on whole module optimization -- optimize across files is my understanding.If I turn on whole module optimization on both the app and the framework, then the app crashes. An unexpected nil in a optional. If I only turn on whole module optimization on the frame work but leave the app fast optimization or debug, then the app does not crash.After some more investigation, it appears a class that inherits NSObject and overrides the initialize method was not called. Turns out the particular class only has class methods and initializes a static properties once. That is no instance methods. ( though it inherits instance methods from NSObject but I'm not
Replies
6
Boosts
0
Views
2.2k
Activity
Sep ’16
Reply to Initialize & whole module optimization
I suspect that none of the following will be news to you. If so, please post some cut down snippets of each of your approaches so that we can see the specific details.Oh, another useful tip in situations like this is to put a breakpoint on your +initialize method, run it in the working case, and look at the backtrace to see how you got initialised. After some more investigation, it appears a class that inherits NSObject and overrides the initialize method was not called.In the above, does “initialize method” mean the initialize() class method (or +initialize in Objective-C)? If so, you do have to be careful here because that method is only called when the class is actually used. For example, this tiny test program prints false unless you uncomment line A. import Foundation var gIsSetUp: Bool = false class Test : NSObject { override class func initialize() { gIsSetUp = true } } // print(Test.self) // line A print(gIsSetUp)For kicks, I got rid of the NSObject inheritance. Then I attempted to s
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’16
Reply to My iMessage isn't working. About 70% of my conversations cannot be opened, as the app crashes. Any ideas to fix it?
This happens consistently with the debbuger attached. The debugger doesn't stop and doesn't display any logs. The only logs that could be interesting (but maybe not reated to my iMessage extension) are:Failed to inherit CoreMedia permissions from 20417: (null) subsystem: com.apple.BackBoardServices.fence, category: Observer, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0 [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/patrickbalestra/Library/Developer/CoreSimulator/Devices/2A1F73AA-01C6-45E6-A085-2E1989D88267/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles [MC] Reading from private effective user settingsNo crash line, no exception, nothing 😟EDIT: I found the issue by trying reach line of my code. The line that was driving iOS crazy in viewDidAppear was:textView.becomeFirstResponder()I just wanted to automaticall
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’16