开发者

Problems with empty table view

开发者 https://www.devze.com 2022-12-22 00:28 出处:网络
im trying to write an app that will display a list off lines from a book e.g line 1, line 2in a table view and you can then select a line to view the corrosponding text.

im trying to write an app that will display a list off lines from a book e.g line 1, line 2 in a table view and you can then select a line to view the corrosponding text.

I've got to the stage where the text should at least appear in the table view(not as far as being able to select it), yet it remains empty.

I used the debugger and was able to find out that there are zero objects in the array used to determine the 'numberOfRowsInSection' and being as this returns zero I think this may explain the problem?

I have pasted up all my code and would really appreciate it if someone has time to skim through it. I know its a big thing to ask but I cant seem to pin point the problem myself.

  • RootViewController.开发者_开发知识库h --> http://pastie.org/858561
  • RootViewController.m---> http://pastie.org/858562
  • BookTestAppDelegate.h ---> http://pastie.org/858566
  • BookTestAppDelegate.m---> http://pastie.org/858567
  • LineClass.h----> http://pastie.org/858568
  • LineClass.m ----> http://pastie.org/858570

SOURCE : http://uploading.com/files/9f5f1249/BookTest.zip/

Thanks guys,


Your sample sqlite database doesn't have table named "animals". But it has table "book". I think you should correct your readLinesFromDatabase method with following SQL statement: select * from book. ;-)

0

精彩评论

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