iOS method not fully implement / method not find?

inzaghi0507

macrumors newbie
Original poster
Jul 25, 2010
2
0
well I am new to iPhone develop.
Recently, I try to do some tableview application,and I follow the book`s example, but I met some problem.



In the .h file I use the two protocol <UITableViewDelegate, UITableViewDataSource>.
The problem is when I try to type the two functions numberOfRowInSection and cellForRowAtIndexPath,
it doesn`t work, and the xcode show me “NO Completions found”.

Then , compile with some warning, just like the puctures below:






It is ridiculous that when I try to paste the book`s example code into my .m file, it is works magically!

I compare the two codes which are the book`s example and I type, anything different is not find.



The question bother me, and I can`t find how to handle it,
please tell me why and how to solve it, THX

and the project file is below:
 

Attachments

Thomas Harte

macrumors 6502
Nov 30, 2005
396
2
Xcode doesn't always spot all potential autocompletions — it's a helpful tool but it isn't authoritative. Just type the whole name for yourself.
 

inzaghi0507

macrumors newbie
Original poster
Jul 25, 2010
2
0
thnaks for your opinion~~
well, i have tried to type the function by myself, not copied from the example

but it still not work:mad:

only one way to make it work is copy the example:confused:
 

Thomas Harte

macrumors 6502
Nov 30, 2005
396
2
Looking at the project you attached, you've named your method:

Code:
-(NSInteger)tableView:(UITableView *) tableView numberOfRowInSection :(NSInteger)section{
When it should be:

Code:
-(NSInteger)tableView:(UITableView *) tableView numberOfRowsInSection :(NSInteger)section{
i.e. rows is plural. You've made a typo, but the fact that Xcode didn't guess the correct autocompletions isn't relevant.