objective c - When do variables' values get defined? -
nsstring *string1 = @"string one"; nsstring *string2 = @"string two"; nsstring *string3 = [string1 stringbyappendingstring:string2 ];
for current version of xcode, above snippet each string1, string2, string3 defined @ compile time or run time?
the code allocate space variables (if compiler deems necessary so) generated @ compile-time , executed @ runtime. 2 constant strings created @ compile-time well, similar constant c strings. message send not executed until runtime.
Comments
Post a Comment