Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

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:

macosxleopard2010072222.png


macosxleopard2010072222.png



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

  • Simple Table.zip
    621.4 KB · Views: 100
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.
 
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:
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.