The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,918 other followers

Archive for December 21st, 2010

cocoa pointer types: the * is mandatory

Posted by jpluimers on 2010/12/21

Coming from a Delphi background I’m highly spoiled by the feature that you do noe need to explicitly mark each and every use of a reference, pointer or class type as being a pointer: they always are, so Delphi implicitly knows. No need for a ^reference marker there (yes, there are a few corner case exceptions to this rule).

The same holds for .NET languages: they know when a type is a reference type, no need for those extra characters.

The Objective-C compiler – used for building cocoa applications in xCode – doesn’t know, so you have to include a star whenever a type is to be used as a pointer.

For instance, this will yield a compiler error “Cannot use object as a parameter to a method“: Read the rest of this entry »

Posted in Development, xCode/Mac/iPad/iPhone/iOS/cocoa | Leave a Comment »

 
%d bloggers like this: