开发者

Invalid receiver type for NSInteger

开发者 https://www.devze.com 2023-01-02 16:09 出处:网络
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@\"bla %@\", [section count]);
  • (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

精彩评论

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