• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: static typing (Learning Cocoa Chapter 13)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static typing (Learning Cocoa Chapter 13)


  • Subject: Re: static typing (Learning Cocoa Chapter 13)
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 22 Sep 2001 22:54:24 +0200

Michael,

>>>>>> Michael Grant (MG) wrote at Fri, 21 Sep 2001 13:19:40 -0500:
MG> I gotcha. It's not "dummyView" but "NSBox" that takes the asterisk,
MG> then. Thanks!

Ammmmm... not really. It's dummyView, which takes the asterisk -- _before_ itself.

NSBox *dummyView;
^^^^^ ^^^^^^^^^^
1 2

1 -- the type NSbox
2 -- the variable dummyView is a pointer to the type (NSBox).

The difference is if you declare more variables:

NSAnything *a,b,*c;

Now, 'a' and 'c' are pointers to NSAnything, whilst b is _not_ a pointer (in
case NSAnything is a class, it would be an error in ObjC).

For a detailed and complete discussion of types and declarations I would
recommend the "K&R" (Kernighan/Ritchie's book of the C language).
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: static typing (Learning Cocoa Chapter 13) (From: Henri Lamiraux <email@hidden>)
 >Re: static typing (Learning Cocoa Chapter 13) (From: Michael Grant <email@hidden>)

  • Prev by Date: Two Dimensional NSArrays
  • Next by Date: Re: static typing (Learning Cocoa Chapter 13)
  • Previous by thread: Re: static typing (Learning Cocoa Chapter 13)
  • Next by thread: Re: static typing (Learning Cocoa Chapter 13)
  • Index(es):
    • Date
    • Thread