method not fully implement / method not find?

Discussion in 'iPhone/iPad Programming' started by inzaghi0507, Jul 25, 2010.

  1. macrumors newbie

    Joined:
    Jul 25, 2010
    #1
    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:

    [​IMG]

    [​IMG]


    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:
     

    Attached Files:

  2. macrumors 6502

    Joined:
    Nov 30, 2005
    #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.
     
  3. thread starter macrumors newbie

    Joined:
    Jul 25, 2010
    #3
    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:
     
  4. macrumors 6502

    Joined:
    Nov 30, 2005
    #4
    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.
     

Share This Page