Pergunta

I am a new iphone developer using xamarin studios.I wanted to know if i need to learn objective-c for handling the ui in xcode? For example,i have made a UIView(subview) in my viewcontroller(.xib) and i need to generate many such similar UIViews on same button click. So do I need to write the event code in xcode .h or .m file or in the .cs file in xamarin studios?

Foi útil?

Solução

No, you do not need to learn Obj-C. It's helpful to be able to READ it, because Apple's samples and docs (as well as a lot of reference material on the web) are written in Obj-C. But you can create your UI using XCode's design tools or directly in code with C# without having to write any Obj-C code.

Outras dicas

The views can be created in xib using interface builder or by code using c#, for the event you have to do it in cs file like in csharp.

No, the Objective-C .h/m. files that Xamarin Studio generates in the Xcode project are just stubs mirroring the actions and outlets on your exported C# classes, so that Xcode UI designer (which only understands Obj-C) can connect to them. You can add outlets/actions to these stubs using Xcode's control-drag connections system, and those will be synced back to C#, but anything more advanced added to the obj-c stubs will be ignored. You must write your actual implementations in C#.

You don't need to learn Objective-C, although it will be helpful. It's more important to be familiar with the Cocoa Touch frameworks, particularly UIKit; this knowledge is no less useful when developing with Xamarin.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top