开发者

Invalid receiver type for NSInteger

  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"bla %@", [section count]);

    return [possessions count]; }

Does anyone 开发者_StackOverflowknow how to implement a simple NSLog because I am getting an error.


NSLog(@"bla %d", section)

NSInteger is basically just an int (but with marginally better-known characteristics).


Here is the most used format specifiers:

  • %d or % D for integer (int)
  • %f for float
  • %@ for String (in general)

You can see the other format specifiers here :
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html


section is of type NSInteger. NSInteger type declared variables does'nt have function with name count. You can print section value with below code.

NSLog(@"bla %d",section)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜