Objective-C compiler error -


need [currentvalue, targetvalue, difference]; line. says initializer element not compile-time element. please post solution.

nsstring *message = [nsstring stringwithformat:                          @"the value of slider is: %d\nthe target value is: %d\nthe difference is: %d",                          [currentvalue, targetvalue, difference]; uialertview *alertview = [[uialertview alloc]]                               initwithtitle:@"hello, world!"                               message:message                               delegate:nil                               cancelbuttontitle:@"ok"                               otherbuttontitles:nil]; 

should be:

nsstring *message = [nsstring stringwithformat: @"the value of slider is: %d\nthe target value is: %d\nthedifference is: %d", currentvalue, targetvalue, difference];  uialertview *alertview = [[uialertview alloc] initwithtitle:@"hello, world!"                                                     message:message                                                    delegate:nil                                           cancelbuttontitle:@"ok"                                           otherbuttontitles:nil]; 

you have '[' before current , and ']' after uialertview alloc.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -