Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone整数乘法_Iphone_Objective C - Fatal编程技术网

iphone整数乘法

iphone整数乘法,iphone,objective-c,Iphone,Objective C,我不明白为什么这不起作用: [abc = ([def intValue] - 71) * 6]; “*”应该是可行的乘法方法,“abc”被定义为NSInteger。('def'是一个NSString)使用例如以下内容: NSInteger abc; abc = ([def intValue] - 71) * 6; 并非Objective-C中的所有内容都属于类类型,例如: NSInteger NSUInteger NSPoint 我也不知道你是从哪里想到要在方括号内完成作业的——我强烈

我不明白为什么这不起作用:

[abc = ([def intValue] - 71) * 6];

“*”应该是可行的乘法方法,“abc”被定义为NSInteger。('def'是一个NSString)

使用例如以下内容:

NSInteger abc;
abc = ([def intValue] - 71) * 6;
并非Objective-C中的所有内容都属于类类型,例如:

  • NSInteger
  • NSUInteger
  • NSPoint

我也不知道你是从哪里想到要在方括号内完成作业的——我强烈建议你通读一遍。

可能重复的内容是无意中重复了你先前提出的问题。我建议你使用
int
而不是
NSInteger