Subscribe ( )

iPhone Programming Tutorials


 

Forum

You must be logged in to post Login Register

Search 

sqlite problems

User Post

1:05 pm
September 26, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

1

code looks like this:

[self vtest];

-(void) vtest {

}

error generated:

Line Location mintViewController.m:42: (Messages without a matching method signature will be assumed to return 'id' and accept '…' as arguments.)

Also, got sqlite errors


Line Location Tool:0: “_sqlite3_prepare_v2″, referenced from:
Line Location Tool:0: symbol(s) not found
Line Location Tool:0: “_sqlite3_close”, referenced from:
Line Location Tool:0: “_sqlite3_open”, referenced from:

2:13 pm
September 26, 2008


Admin

brandontreb

posts 88

2

bob,


First, is vtest declared in the .h file?  All methods must be declared in the .h.  The sql errors look like you forgot to import the sqlite3 libraries into your project.  Let me know if that helps…

If debugging is the process of removing bugs, then programming must be the process of putting them in.
-Edsger Dijkstra

2:54 pm
September 26, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

3

Hi Brandon,

thanks for the quick response.

Yes, when I include vtest in the “h” it works, but you used (private) to declare the methods and your code works.

I did  #import <sqlite3.h> in the appdelegate.h file.

3:40 pm
September 26, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

4

Hi Brandon,

I uploaded a small test that illustrates the problem. Doing a build generates the errors.

2:03 pm
September 29, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

5

Never mind. I found out what I did wrong.

3:11 pm
September 29, 2008


Admin

brandontreb

posts 88

6

Glad to hear it.  Sorry I didn't respond in time…It's been a long weekend.

If debugging is the process of removing bugs, then programming must be the process of putting them in.
-Edsger Dijkstra

11:02 pm
September 30, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

7

In this line of code:

Todo *td =[[Todo alloc] initWithPrimaryKey:primaryKey database:database];

I don't understand how Todo and td can be used since I cannot find any declaration of either.

In the project I am working on, I get errors saying both are undeclared, first use in this function. Obviously the variables are not Todo and td, but still, in Apple's Books example, Book and book are used without a problem.

What am I missing?

10:24 am
October 1, 2008


Admin

brandontreb

posts 88

8

Todo *td; is declaring td as an object of type Todo.  We can do this because in the .h file, we did a #import “Todo.h”. 


So by importing the Todo.h file, this allows us to build new instances of Todo objects (ie calling their init functions).  td is simply an instance of a Todo.


Does this make sense?

If debugging is the process of removing bugs, then programming must be the process of putting them in.
-Edsger Dijkstra

11:43 am
October 1, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

9

So, we can call Todo because of the definitons in its .h file and .m files. I got confused because every other variable in the project was defined as NSString *mystring; with its property and synthesize statements.

Thanks for the help.

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

4 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.