Determine if a string already exists in UITableview, XCode 7, Swift 2

Hi


Is there a search mechanism for UITableview to determine of a String alreadys exists in it? I would like only one occurance of any String I get to be in the table.


Thanks...

Accepted Reply

To start, I recommend you review the Model-View-Controller section of Cocoa Core Competencies.

Within that framework, table views are… well… views. As such, they are a view on to your model data, not the data itself. If you want to search your data, you wouldn’t search the table view, you’d search the model that the table view is showing.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

To start, I recommend you review the Model-View-Controller section of Cocoa Core Competencies.

Within that framework, table views are… well… views. As such, they are a view on to your model data, not the data itself. If you want to search your data, you wouldn’t search the table view, you’d search the model that the table view is showing.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks eskimo, I let out a big 'DUH!! when I read that. My data for this is in an array and it was easy 🙂


Thanks...


"Everybody's in despair

Every girl and boy

But when Quinn the Eskimo gets here

Everybody's gonna jump for joy"