 |
 |
#pragma
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Status:
Offline
|
|
I see it often in the Apple sample code, but there's no documentation in the Learning Cocoa Book, and I can't find any in Apple's Objective-C book. I can see that its used with something involved in method declaration. Can anyone provide me with a better description of what it does, and if I should use it?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2000
Location: Wisc. Rapids, WI, USA
Status:
Offline
|
|
Originally posted by Spiffster:
I see it often in the Apple sample code, but there's no documentation in the Learning Cocoa Book, and I can't find any in Apple's Objective-C book. I can see that its used with something involved in method declaration. Can anyone provide me with a better description of what it does, and if I should use it?
pragmas? which one specificially? In general they are a way of talking to the compiler/preprocessor/whatever that is outside of the programming language that you are using. They are almost always compiler/development environment specific.
the only documentation that I've seen for Apple's stuff is here (assuming developer tools are installed):
file:///Developer/Documentation/Deve...cessor.19.html
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Are you talking about #pragma mark?
It allows you to put a label into your code that the pop-up recognises so if you can put the following:
Code:
#pragma mark -
#pragma mark ??? OBEX Client Session Selectors ???
- (void)commandSentCallback:(const OBEXSessionEvent *)inSessionEvent
{ ...
( ??? should be three Bullets)
you get this in PB:
http://www.monkeyfood.com/thestuff/f...pragmamark.png
The one with just the dash makes a separator and the bullets (option 8) make things easier to spot
(Last edited by Diggory Laycock; Feb 4, 2003 at 04:27 AM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Status:
Offline
|
|
Thats it Diggory. I see Apple used it like this
#pragma mark PUBLIC INSTANCE METHODS
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
The word is #pragma once and #import are going to be deprecated in the next version of gcc. Might think about using header guards on new source instead of relying on #import to prevent multiple inclusion.
On Thu, Feb 06, 2003 at 12:49:19PM -0800, Zack Weinberg wrote:
So we had a discussion of the problems that PCH poses for #import,
which expanded to a discussion of the problems of #import and
#pragma once generally, which then pretty much wound down without any
middle ground being found between 'there must be some way to fix it'
and 'no, sorry, there isn't'. I think that an executive decision is
required at this point, which falls to me as cpplib maintainer.
Accordingly: #import and #pragma once will be removed from FSF GCC in
3.4. I will shortly send a patch to gcc-patches to implement that.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Apple might keep #import in their gcc, which is a fork from the fsf codebase. I just fired off a mail to Stan Shebs asking him about it, I'll check back here when I get an answer 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|