我得到在創建NSIndexPath警告,NSIndexPath警告的對象 -
NSInteger arr[] = {0,3};
[NSIndexPath indexPathWithIndexes:arr length:2]
warning: pointer targets in passing argument 1 of 'indexPathWithIndexes:length:' differ in signedness
什麼是由於警告?如何使它工作?
感謝
我得到在創建NSIndexPath警告,NSIndexPath警告的對象 -
NSInteger arr[] = {0,3};
[NSIndexPath indexPathWithIndexes:arr length:2]
warning: pointer targets in passing argument 1 of 'indexPathWithIndexes:length:' differ in signedness
什麼是由於警告?如何使它工作?
感謝
您需要讓該陣列的類型爲NSUInteger
(無符號)。
它告訴你,因爲NSIndexPath不希望負值,你可能會通過一個NSInteger數組(真的是一個int)傳入。
假設你正在爲iPhone開發,你應該使用用於創建索引路徑來代表UITableViews
位置的UIKit增加。您應該像這樣構建您的示例:NSIndexPath *myIndexPath = [NSIndexPath indexPathForRow:0 inSection:3];
有關更多信息,請參閱this Apple documentation。
這只是iPhone,但他沒有在標籤中指定iPhone ... – 2010-01-11 04:16:48
謝謝...它的工作。 – Biranchi 2010-01-11 05:13:21