Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-24-2009, 04:45 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 3
mynameistripod is on a distinguished road
Default Need Help with getting Info from SQLite3

Hi, before I saying anything, I just want to say I am new to this and I apologize in advance for asking questions that may seem obvious. I'm just trying my best to learn up on these stuff. =)

I am currently trying to load a random word when a user touches up on a UIButton; where the random word comes from a SQLite table. What I did so far was make an (IBAction) for the button to generate a random number.

- (IBAction)generateRandomid)sender {
srandom(time(NULL));
int row = arc4random() % MAX + 1 ;
}

With this generated number I want to go back into my SQLite table to match what word is saved in that row number. In my SQLite table, i set up an id for the number and a word column.

A friend of mine said I need to query something. Would you all be so kind enough in explaining what I should do to accomplish what I need to do?

I would greatly appreciate it. Thank you!
mynameistripod is offline   Reply With Quote
Old 05-24-2009, 05:43 PM   #2 (permalink)
Registered Member
 
msencenb's Avatar
 
Join Date: May 2009
Location: Stanford, CA
Posts: 291
msencenb is on a distinguished road
Default

You might take a look at the SQLite books code example from apple within the developer portal
__________________
I'm starting a new blog dedicated to iOS development. Check it out at:

http://www.iosdevscreencasts.com
msencenb is offline   Reply With Quote
Old 05-24-2009, 06:08 PM   #3 (permalink)
Lost in a sea of code
 
BostonMerlin's Avatar
 
Join Date: Apr 2008
Location: Boston
Posts: 399
BostonMerlin is an unknown quantity at this point
Default

several things need to happen.. follow this tutorial. if it doesnt make sense..provide examples of code your having a problem with.

iPhone SDK Tutorial - Using SQL Lite Part I - iPhone SDK Articles

Hope that helps
John
__________________
----------------------------------------------------------------------
I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
BostonMerlin is offline   Reply With Quote
Reply

Bookmarks

Tags
database, random, sqlite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 339
6 members and 333 guests
givensur, ipodphone, jbro, mer10, n00b, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:08 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0