0

Just started on Objective-c from the c# world.

I'm quite enjoying the "intellisense" on XCode, but because of the lack of generics I wondered if it was possible to explicit type for code readability and "intellisense".

So what's the syntax in Objective-c for this in c#:

//explicit typing in c#
(string)someobject;
((string)someobject).ToLower();

cheers

Doctor Jones
  • 20,516
  • 12
  • 73
  • 98
andy
  • 8,495
  • 13
  • 74
  • 122
  • 1
    Note that casting in Objective-C is generally a sign that your code isn't structured or written correctly. It should be exception, not the rule. – bbum Dec 21 '10 at 22:35
  • surely it depends on your coding style? A lot of c# developers love to use "var", I don't, meaning my coding style emphasises readability and clearness. I personally like static typing very much, for many reasons. In a language where generics don't exist, such as objective-c, I can't see how it's possible for me not to use explicit typing. I'm not doing it for the compiler, I'm doing it for myself. No? – andy Dec 22 '10 at 17:52

0 Answers0