Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.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
Objective c 方法名称以及“from”和“with”的使用_Objective C_Ios_Xcode_Naming Conventions - Fatal编程技术网

Objective c 方法名称以及“from”和“with”的使用

Objective c 方法名称以及“from”和“with”的使用,objective-c,ios,xcode,naming-conventions,Objective C,Ios,Xcode,Naming Conventions,在方法名中使用From或With有什么意义吗 [NSIndexPath indexPathForItem:item inSection:section]; [NSIndexPath indexPathWithIndex:index]; 如果是这样的话,我会猜测,无论是从还是从,都不会,但我从未听过任何关于这方面的讨论 如果不是,为什么方法的命名方式不同?如果他们都有With或From,这不是一回事吗?它没有任何意义,只是有助于使方法更具可读性和人性化。它除了semanthic之外没有任何意义

在方法名中使用From或With有什么意义吗

[NSIndexPath indexPathForItem:item inSection:section];

[NSIndexPath indexPathWithIndex:index];
如果是这样的话,我会猜测,无论是从还是从,都不会,但我从未听过任何关于这方面的讨论


如果不是,为什么方法的命名方式不同?如果他们都有With或From,这不是一回事吗?它没有任何意义,只是有助于使方法更具可读性和人性化。

它除了semanthic之外没有任何意义