Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nnavick

macrumors regular
Original poster
Oct 13, 2010
100
0
Hi,
since I stated developing for iphone i don't understand this issue,
I want to know how to write function & variables names,I mean,

-(void)is_open;?
-(void)Is_Open;?
-(void)IsOpen;?
-(void)isOpen;?

and variables

IBOutlet UIButton *cancelButton;?
IBOutlet UIButton *cancel_button;?

how do you write them?

Thank you!
 
Last edited:

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Look at any Apple class. Method names always start with a lower case letter and then each subsequent word is has an initial upper case letter. Words are never separated by underscores. So there is only one viable answer:
Code:
-(BOOL) isOpen;
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
C naming is case sensitive and allows underscores. Anything that you find readable will work. If you read a lot of Apple sample code and find that to be a readable coding style, you might want to copy those naming convention. If not, don't. The C code will still compile just fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.