views:

77

answers:

2

NSString *titl = [database executeNonQuery:@"SELECT * FROM numberquestion"];

gives warning "initialization makes pointer from integer without a cast"

What is Wrong?

Table "numberquestion" contains only one string "twenty" of type TEXT

Thanks in advance

Ur suggestions are most welcome.

A: 

Your database object seems to return an int on executeNonQuery:@"SELECT * FROM numberquestion".

If its some sort of generic database accessor I would expect an array or a similar structure as result for a “SELECT * …”.

But as the method reads “executeNonQuery:” it maybe only returns a state (encoded in an integer), because you don't expect a result (exectuteNonQuery).

Tilo Prütz
Almost certainly an integer status is being returned.
JeremyP
A: 

my mistake Got the answer. executeQuery in place of executeNonQuery should be used

PARTH