Replacing default 'ship.scn' scene with blender object crashing app - scenekit

I am trying to add an object from Blender into the default AR project in xcode.
I export my object from Blnder as a .dae and convert to .scn inside of xcode (editor
I then replace the default "art.scnassets/ship.scn" scene with my imported file name (art.scnassets/monkey.scn). When I try to run the app I get a "unexpectedly found nil while unwrapping an Optioinal value." What am I doing wrong??

There's not all that much to go by in your question, but I'm guessing that – since you say that you replaced the asset and didn't change any of the code – that the project is crashing because the code that loads the scene is still looking for a file with the old "ship" name which is no longer in the project. In which case the code would fail to load the file, returning nil which then when force unwrapped results in that error you're seeing.
To solve that problem: ensure that the code that loads the scene is using the name of the new asset.

Related

What is the correct usage of the mixin classs for TCL language?

Im attempting to update an old version of the selenium-tcl package to work with the new W3C WebDriver (or Selenium 4.0).
Original packages uses a few mixins for the webdriver class.
So I modeled what I saw and created a mixin file named mixin_action_chains.tcl [1] which has a mixin class called Mixin_Action_Chains.
Whenever I attempt to use it I get the error:
% package require selenium
::selenium::Mixin_Action_Chains does not refer to an object
Im not sure why I've modeled it pretty much exactly as I have seen in the other files such as mixin_for_scrolling.tcl [2]* file. What am I missing.
Here is the entire GitHub Repo
Im not sure what else must be done for TclOO. Any thoughts.
Thanks
Im not sure what else must be done for TclOO. Any thoughts.
Update
pkgIndex.tcl: The placement of the mixin-defining script mixin_action_chains.tcl is wrong, it comes after the mixin has already been required in the previously sourced script webdriver.tcl, like entering directly:
% oo::class create C {
mixin ::not::defined
}
::not::defined does not refer to an object
You need to change the order of source command calls in the package ifneeded script.
For the records
Still, in the original version, there were unbalanced curly braces and brackets in your script, which broke sourcing of the file for me:
https://github.com/SavSanta/w3cselenium-tcl/pull/1

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

Converting .OBJ File Text to a GameObject in Unity?

So what I am trying to do is instantiating a .obj file locally stored on the device AFTER BUILD. I have searched for hours but in vain...
I already managed to make a file explorer in unity, which returns the URL of the selected .obj file. Then I use WWW(string url) load the object.
WWW bundleRequest = new WWW(#"file://" + pathName);
To this point, everything is perfect.
And here is my question: Is there a way to convert the text of the file, so bundleRequest.text to an instantiable GameObject AFTER BUILD? Through any means possible: APIs, extensions, etc.
Thank you in advance
This asset has helped me before, Runtime OBJ Importer, it's free too!
https://assetstore.unity.com/packages/tools/modeling/runtime-obj-importer-49547

Codenameone new GUI Builder null pointer when trying to assign image to button

When using the new GUI Builder (CN1 plugin v3.6.0) I can attach an image from my res file to a Button and it appears in the preview nicely
but when I try to run the code in the Simulator I get a NullPointerException on the line
gui_ordersButton.setIcon(resourceObjectInstance.getImage("Orders.png"));
As this is in the magic "do not edit below this line" block how can I fix this?
Many thanks.
Two elements can throw a null pointer from this exact line:
gui_ordersButton.setIcon(resourceObjectInstance.getImage("Orders.png"));
gui_ordersButton or resourceObjectInstance. If the image isn't available in the resources the null pointer will come from the setIcon method.
I'm guessing resourceObjectInstance is null because you changed something about the way resources are loaded in the default project or you used the constructor of the form that passes null as the resources object.

Could not insert new outlet connection [duplicate]

This question already has answers here:
Xcode 4: Creating a UIView xib, not properly connecting
(33 answers)
Closed 9 years ago.
Could not insert new outlet connection: Could not find any information for the class and not showing any class named "ViewController"
Solutions I have done :
- Restarted XCode
- Restarted System
- Deleted the Deriveddata contents from /Library/developer/xcode
But nothing worked for me
Here is the screenshot for the error
I got the same problem as you today... I think this is a bug of Xcode, below is the way to fix the issue:
Close the project you are working on with.
Delete your project's【DerivedData】folder. (This folder may inside your project's folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you.
restart your project.
After these steps, the problem should be solved. And from my experience, these steps can solve many Xcode problems, so if you got some problem with Xcode again, try these steps first.
Removing(removing reference, not deleting) and then adding the appropriate file(the file of class you want to add the outlet to) is actually enough.
Edit 1 I found that after unchecking (in XCode 6.3.1) I had to wait a few seconds for the Indexing to appear and complete in the project name box. Same for the way backwards. This increased chances to fix the issue in almost all (but not all) cases.
Edit 2
Removing reference means that You do not delete the file completely but just remove it from the project (it still exist in the folder of your project, you add it later).
That's most often a problem of file indexing.
To fix it try to clean your target and if this doesn't work, go to your Derived Datafolder and delete your application there.
This will force xCode to reindex the files
Just got the same issue on Xcode 4.6.2.
Tried solutions presented in different answers/comments, but it still didn't work.
Then all I did was to just:
save all my work;
just quit Xcode & load it again;
then I was able to insert the new outlet connection successfully.
Hope this will save some time/frustration for somebody else.
Personally, I had the same problem: "could not insert new outlet connection" AND when I was starting typing something like "UI..." XCode wasn't doing anything.
I searched for answers, I tried several things... but it was just an unchecked box. When I was creating a new class, XCode unchecked the box linking the class to the project (I guess).
I can't post a screen shot because I don't have 10 reputations but when you create your class, XCode asks you where you want to save it. Down the finder window, you have 'Targets' and two boxes: 'YouProjectName' and 'YouProjectNameTests'. You should check the first one (at least).
Hope this will help. I saw different discussions about the subject.
I recently came across this problem. I soon realized that the cause had been my own doing. I had previously disabled XCode indexing (which used to take forever & eat up my RAM), using the below code in a terminal window:
defaults write com.apple.dt.XCode IDEIndexDisable 1
To revert XCode to its default state, i used the following line in a terminal window:
defaults write com.apple.dt.XCode IDEIndexDisable 0
Voila! All's well again..
If you've imported the Class into your Xcode Project you have to manually add the Class (.m file) to your 'Compile Sources'.
Select project icon > TARGETS > Build Phases > Compile Sources
Click the + button and add your *.m file.
Finally I did it by removing the xcode completely from my mac and reinstall the xocde.dmg file and then install MobileDevice.pkg and MobileDeviceDevelopment.pkg residing on /Applications/Xcode.app/Contents/Resources/Packages
make sure that your source have had been included in the "Build Phases" place.
This do fix my problem. But I think Xcode is still really buggy and annoying.

Resources