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 10-10-2011, 08:23 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Default How to test if a table view has a certain cell?

Hey everyone,

I have a table view that can add and delete cells. I only want the user to be able to add one of each cell. (one of each, i mean i have buttons and i only want the user to press the button once). Is there a way to test if my table view has a certain cell in it?
Thank You in Advance!
xcoderx is offline   Reply With Quote
Old 10-10-2011, 08:25 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Your data model should be keeping track of this.
baja_yu is offline   Reply With Quote
Old 10-10-2011, 08:26 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Your data model should be keeping track of this.
okay cool, so how could i test this? Thanks
xcoderx is offline   Reply With Quote
Old 10-10-2011, 08:27 PM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Depends on what your model is. Usually it's an array or a similar ordered collection. So just loop through it and check. Keep in mind the MVC architecture, views don't own data so anything you want to store and keep a record of should be in the model.
baja_yu is offline   Reply With Quote
Old 10-10-2011, 08:28 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Depends on what your model is. Usually it's an array or a similar ordered collection. So just loop through it and check. Keep in mind the MVC architecture, views don't own data so anything you want to store and keep a record of should be in the model.
Oh okay so i add my content to an NSMutableArray, so in a sense, i could just check to see if the array has like certain text? Thanks
xcoderx is offline   Reply With Quote
Reply

Bookmarks

Tags
tableview, uitableview

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: 400
19 members and 381 guests
13dario13, 7twenty7, buggen, eski, EvilElf, glenn_sayers, HemiMG, jarv, LunarMoon, morterbaher, n00b, pbart, Pudding, QuantumDoja, sacha1996, Sami Gh, UMAD, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

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