當我使用此代碼,Xcode中給我一個錯誤:參數太多方法調用,預計,1,有21
NSArray *buttonsFiles = [NSArray arrayWithObject:@"button_plus.png",@"button_minus.png",@"button_multiple.png",@"button_div.png",@"button_eq.png",@"button_percent.png",@"button_sqrt.png",@"button_back.png",@"button_pointer.png",@"button_c.png",@"button_0.png",@"button_1.png",@"button_2.png",@"button_3.png",@"button_4.png",@"button_5.png",@"button_6.png",@"button_7.png",@"button_8.png",@"button_9.png",nil];
我應該用這個來避免這個錯誤嗎?
NSString *myfile1 = [@"button_plus.png"];
NSString *myfile2 = [@"button_minus.png"];
...
NSString *myfile20 = [@"button_9.png"];
NSArray* myArray = [NSArray arrayWithObjects:myfile1, myfile2... myfile20r, nil];
我覺得NSString * myfile1 = [@「button_plus.png」];這可能是問題所在。試試NSString * myfile1 = @「button_plus.png」;並檢查。 – Rushi