I have an warning while returning an NSInteger. I am using UITableView’s inbuilt method numberOfRowsInSection. When i am returning it, It gives me an warning which is (Incompatible integer to pointer conversation returning ‘NSInteger’ (aka ‘int’)from a function with result type ‘NSInteger *'(aka ‘int *’)).
I am using this code.
-(NSInteger *)tableView: (UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSInteger row=10;
return row;
}
The compiler’s right! Your method returns a pointer to an
NSInteger. This is the signature you want:NSIntegeris not an objc object, it’s anintor along.