Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by longshot · Aug 29, 2010 at 01:58 PM · iosiphoneipad

System.Reflection on iOS in Unity 3

Is System.Reflection available on iOS with Unity 3? and if it is, are there any quirks?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Alex-Chouls · Jan 27, 2011 at 05:04 PM

I've been using System.Reflection on iOS with Playmaker and haven't run across any issues.

I remember reading that Emit doesn't work on iOS.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tbj22 · Feb 07, 2014 at 08:05 PM 0
Share

http://docs.xamarin.com/ios/about/limitations#System.Reflection.Emit "Important: Do not confuse Reflection.Emit with Reflection. Reflection.Emit is about generating code dynamically and have that code JITed and compiled to native code. Due to the limitations on the iPhone (no JIT compilation) this is not supported.

But the entire Reflection API, including Type.GetType ("someClass"), listing methods, listing properties, fetching attributes and values works just fine."

avatar image
0

Answer by Paul Ash · Feb 17, 2011 at 06:05 PM

I've been running into problems with it. Where the iPhone crashes when trying to do Assembly.Load

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreamora · Dec 26, 2011 at 05:55 PM 0
Share

Assembly load will not work, iOS is AOT compiled not JIT. Also dynamic code adding is forbidden on iOS (and can get your app black listed and your dev account banned if you try to circumvent it), you would have to add scripting if you want to do such a thing, so it uses the same compiled code base all the time

avatar image Bunny83 · Dec 26, 2011 at 08:53 PM 0
Share

Also be careful. If you use code-stripping to reduce the filesize Unity could strip things away you might want to access via reflection. Since reflection is dynamic, Unity can't deter$$anonymous$$e that at compile / build time.

In most cases if you use at least each classname somewhere in a included script there should be no problem, but in some rare cases you could shoot yourself in the foot

avatar image Dreamora · Dec 26, 2011 at 08:57 PM 0
Share

Or simply look at the documentation, understand what link.xml is for and you are normally safe too :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity 3 and Unity iPhone Basic 1 Answer

IPhone 4 and IPad 2 lost audio on resume 0 Answers

How do I destroy things properly to free up memory? (iOS) 3 Answers

What does Mprotect remapping failed mean and how do I fix it? 1 Answer

Fixing Layout issues for iPad 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges