Subscribe ( )

iPhone Programming Tutorials

 

Forum

You must be logged in to post Login Register

Search 

Expanding sqlite program

User Post

8:14 pm
October 13, 2008


cmcintosh2

Noob

posts 4

1

Okay, so i am looking at making a sqlite similar program.


My program will have Categories of Games, and Rules for those games.  The table structure looks somewhat like:

category:
pk int primary key, title varchar(), active(BOOL)

game:
pk int primary key, catId int, title varchar(), active(BOOL)

rule:
pk int primary key, gameId int, ruleText text

Okay so far, I have my first table populating from the category list(user clicks cell and goes to next view).  I have it pushing the view for a new tableViewController which should be populating with the games that are of the selected category.

On first run I am just trying to get it to populate with any games, but I am getting an error:: -[GameViewController myGames]: unrecognized selector sent to instance, from my understanding from what i have read online i have to do something called a -performSelectorOnMainThread,  doing so apparently will run the required function(which right now the object for game, appDelegate, and viewController(s) are all the same in functionality as the ones for category table).

So not sure where to go from here as far as creating a function that is called to then populate the table.  I am going to fiddle around a bit more, but any pointers would be great help.


9:00 pm
October 13, 2008


cmcintosh2

Noob

posts 4

2

Okay not sure if this is along the correct path, but Ill try.  Should i maybe run the query and build the array in the rootViewController, then send it to the gameViewController (second tableView) when the user clicks on the cell?


Not sure if this is along the right road, but maybe someone will shoot me an idea.  Thanks in advance.

6:05 am
October 16, 2008


cmcintosh2

Noob

posts 4

3

Still having problems nailing it down, but i think i may try the tack of placing all the code to call the new table in the first tableView controller.  Any suggestions would be great.

10:21 am
October 16, 2008


Brandon

Admin

brandontreb

posts 79

4

I'm not quite sure I understand the problem.  Could you please maybe post some screenshots to highlight it?

11:00 am
October 16, 2008


cmcintosh2

Noob

posts 4

5

Cant get screen shots at the moment, i will post the error and describe what i am doing.


So i have the first table view, this view is pulling a list of categories from an sqlite db.  When you click on a category, it should then load up another table view with a list of the games that match to that category, also in the database. However, what is happening is the following run-time error:


2008-10-16 12:58:10.848 iDrinkMe[34111:20b] *** -[iDrinkMeAppDelegate gamesArray]: unrecognized selector sent to instance 0×44fff0
2008-10-16 12:58:10.849 iDrinkMe[34111:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[iDrinkMeAppDelegate gamesArray]: unrecognized selector sent to instance 0×44fff0'
2008-10-16 12:58:10.851 iDrinkMe[34111:20b] Stack: (
    2440716619,
    2535096571,
    2440745802,
    2440739148,
    2440739346,
    13762,
    816441448,
    816442476,
    816513517,
    816465484,
    837317240,
    837317032,
    837315376,
    837314643,
    2440210882,
    2440217636,
    2440219896,
    829005112,
    829005309,
    816175835,
    816221412,
    8972,
    8826
)


I have checked the names and they are correct, and if i switch the first tableView to test the code i setup for the games list(created new nsObject: games, and a new array gamesArray) it works.  So not really sure what im doing wrong.


About the iCodeBlog forum

Currently Online:

4 Guests

Maximum Online: 19

Forums:

Groups: 2

Forums: 6

Topics: 137

Posts: 453

Members:

There are 246 members

There are 1 guests


Brandon has made 79 posts

Top Posters:

bobcubsfan - 43

crazyiez - 30

VertigoSol - 17

Uhu - 17

Nick - 15

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)  

Share and Enjoy: