Define with 'k'? [duplicate] - objective-c

This question already has answers here:
Objective C - Why do constants start with k
(6 answers)
Closed 9 years ago.
I have always wondered, when you define something such as a string (or anything for that matter), why do people put a 'k' ahead of the defined name?
e.g. #define kHello = #"Hello"
What's that 'k' all about?

I'm pretty sure the 'k' is short for constant. (Don't ask me why it's a k.)

Related

Fortran: Variable initialization wwith parenthesis [duplicate]

This question already has answers here:
Array declaration in FORTRAN for beginners
(2 answers)
Closed 6 years ago.
I am trying to understand a Fortran90 code. In the code, I found this expression for initializing a variable:
integer :: time(8)
What is meant by this? What does the parenthesis do?
That syntax declares an INTEGER rank one array of size eight.
(In Fortran terminology that source does not initialize anything and it is a declaration, not an expression.)

objective-C '$' notation [duplicate]

This question already has answers here:
what does dollar sign mean in objective-c?
(2 answers)
Closed 9 years ago.
I'm still new to objective-c I went through a code example from git hub and saw '$' notation before parameters for example:
titleLabel.$height = TITLE_HEIGHT;
can some one explain the difference between titleLabel.$height and titleLabel.height
The property happens to include a dollar sign in its name, it has no significance.
For Example:
#property int $height;

Remove a random expression from column [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Remove a random expression from string
I have a column which contains values like this
"000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF";
I want to create a substring which doesn't have the part x3A 973911 in it.
Whic means I want something like this,
000003023_AggregateStopLossLimit_W_2012-12-22.PDF
The value x3A 973911 is not constant, so basically, in words, I want the part of string to be removed which comes after the first space and ends at the next '_'.
Any ideas ?
String phrase="000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF";
phrase.replace("x3A 973911","");
//am not sure if you have to trim() but i guess this will answer your question.

Does an 'if' statement always evaluate all conditions? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Does Objective-C use short-circuit evaluation?
If an object is of a certain type, and a property of that object has a certain value, I want to do something.
Can I use:
if (objectIsOfType:x && object.property == y)
or do I need to nest these? Assume that asking for object.property will through an error if the object is not of type x.
No. Objective C (as C and many other languages) uses short circuit evaluation.
Objective-C supports short-circuit evaluation(from left to right).
but in any way, you need to check object on nil :))

What does the symbol ^ mean in Objective-C? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Caret in objective C
I just want to know what this ^ symbol means in Objective-C.
It can mean several things:
type (^name)(arguments)
is a declaration of a block object.
^(arguments) { ... }
is a block object literal
x ^ y
is the bitwise XOR operator
It is used to define blocks in later versions of iOS. See http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html
It means a couple of things:
It can mean bitwise XOR.
It can also signify a pointer to a block (just like * is marks a pointer to a function).