If I subclass SCNParticleSystem and add a property to the custom subclass, and assign a value to the property. SceneKit will crash on Mac. But it works on iOS and tvOS!
The crash always occurs when the particle systems emitter shape is being assigned a SCNNode geometry!
Its that: EXC_BAD_ACCESS (code=1...)
See the screenshots & test my simple example project.
I don’t understand why this is crashing, is there a workaround? How can I add custom properties to a SCNParticleSystem otherwise?
Xcode 7.2
Xcode 7.3 beta (7D111g)
Mac OS X 10.11.3 (15D21)
Example Project
Related
I have an android background, but am just learning how to build iPhone apps using swift. I am using the book Beginning iPhone Development with Swift 2: Exploring the iOS SDK.
Problem is that it refers to Buttons and such being in the Object Library and I don't have anything in my object library. I have clicked on the View as instructed.
I have a newly installed MacBook and am running Xcode 8.1, which is newer than the book's directions. It refers to iOS UIkit, but I don't know how to install this.
I did Single View Application under iPhone to get where I am. Can anyone point me to what I need to do? I am brand new to the Apple world entirely.
Aha! In the main window, I clicked on the storyboard and that allowed the Object Library to contain the view items, including buttons.
So, click on the storyboard in the main window, then click on the view in the IB.
I have an app developped under Xcode7 in 10.10
I changed the deployment target system to 10.8 because of the IT situation of another school.
The 10.8 app runs fine under 10.10, but on an 10.8 machine, I only see a window grayed out in the face of the MainMenu.xib included the menus, but inactive. Its reaction are as in IB. The previous login windows called at startup are not shown.
In the console I only see a warning about 'Invalid color System labelColor'.
Explanation:
I reduced my project to the Start nib window and the MainMenu.xib. I looked for labelColor in every single nib and xib file with BBedit.
When I compile, I look in the content of the compiled app and can find a MainMenu.nib (not xib) with a single String Item labelColor.
Runnig the app in 10.10 is fine, but in 10.9 the warning appears.
Explanation 2:
Problem fixed: The labelColor is inserted in 10.10/Xcode7 with an NSBox inserted in IB. Obviously this was changed when I transfered the rather old project to Xcode7. I don't know if this is changeble.
MacBook Pro (Retina, 15-inch, Mid 2015)
El Capitan 10.11.1
Xcode 7.1 (7B91b)
When I do File > New > File, Subclass of: UICollectionViewController, I get an implementation file containing only:
#import "CVCTest.h"
#implementation CVCTest
#end
So, there are none of the UICollectionViewDataSource and UICollectionViewDelegate method stubs I expect. This is true for new UITableViewController and UIViewController subclass files as well.
This seems to be a suddenly new phenomenon; I created a UICollectionViewController subclass in a project last week which came with the stubbed methods. Xcode seems to have lost the class file templates.
After deleting the Xcode app and the ~/Library/Developer/Xcode directory, rebooting, and installing Xcode 7.1 from Mac AppStore, the behavior is the same.
I checked with on colleague whose Xcode behaves this way and then with another whose Xcode behaves as expected.
Anyone else experiencing this? Any clue what might be causing this?
Ok. A critical piece of information I left out of my question is that I was subclassing a controller class for an iOS project. The "o.m.g" answer is that somehow
OS X source
was selected at the bottom of the left pane of the source type selection view, instead of
iOS source
With iOS source selected, I get the class template file with the expected stubbed methods.
wow.
My app must run on OS X 10.6 through 10.9. The main window xib has a deployment target of 10.6 (same as the app itself). The main window nib also has the "Full Screen" attribute set to "Primary Window".
Since 10.6 doesn't support NSWindowCollectionBehaviorFullScreenPrimary, XCode 5 expectedly gives the warning Attribute Unavailable. Full Screen behavior on OS X prior to 10.7.
Questions
Can you ignore this warning and build safely for 10.6 without a crash on nib instantiation?
You can remove this warning by setting the xib deployment target to 10.7, but will the nib still run on 10.6? In other words, doesn't a xib deployment target of 10.7 cut off support for 10.6?
The "proper" solution seems to be to keep the deployment target at 10.6, unset the Full Screen attribute in the xib, and instead set it programmatically at runtime if running on 10.7+. Is this how you should always handle situations like this?
Generally, how does OS X fall back when attributes specified in nibs don't exist at runtime? I can't find a straight answer. Thank you.
The deployment target is the earliest OS version that can load the xib file. To answer Question 2, setting the deployment target to 10.7 cuts off support for 10.6. The nib file will not run on 10.6.
You listed the solution for supporting 10.6 and later in Question 3. I don't have an answer for Question 4.
Fairly new to the Xcode Developer API and need a little help. When a project is first opened in Xcode, the Object Library displays the full list of UIKit objects available (and other linked frameworks I believe). However, when I switch files in the project navigator to/from any file (.m, .h, .xib, etc), the Object Library list changes; most of the objects are missing - such as NSButton, NSTableView etc. The standard objects are still visible - Label, Round Rect Button, Text Field, etc.
Closing and re-opening the same project appears to restore the Object Library list, but the same issue happens once a different file is opened.
Using Xcode Version 4.2.1, Build 4D502.
Help!
I think I see what you are describing. When I first open an iOS project the Object Library is showing objects that are valid for OS X but not iOS (like File Menu Item). When I switch to a xib file the Object Library gets updated to show only the objects that are valid for iOS. Ideally I suppose that wouldn't happen but since you can't do anything with the Object Library while a source file is in the editor no harm is done.
If you are developing application for iOS(iPad or iPhone) you will not get that library which contains pop button , check box ,NSButton, NSTableView etc,that library is available for OS X app development.
OS and OS X don't use the same graphics library. iOS and OS X development are similar, but not the same. For example - you don't have Cocoa Bindings on iOS.
I you want to check then make one project for iOS & then see your library contents,then create another project for OSX & see your library contents... :D