Quote:
Originally Posted by Brettyboi
Hi Matt, thanks for your response!
Sorry to be a pain but would you mind trying to give me an example? I'm having trouble implementing the line of code provided.
Let's say that for any cell containing the word 'News' I want it to automatically display news.png, and for any cell that contains the word 'update' I want the cell to display update.png
Is the line of code you provided all I need? Or do I need to declare anything else in my header file?
Thanks again
Brett
|
You've just changed the parameters of what you're after - firstly you said that the image should be based on the "first word" of the text. Now you're implying that the cell just has to contain the word 'news' anywhere in it? What if the cell contains multiple keywords, such as "...this is an
update to the
news about..."?
But let's assume you're after the first word in the cell. You have the text to display in the cell, correct? So just grab the first word from that and use it as the basis for your image filename (using the code provided).
(Extract your first word of the text into an NSString variable, and replace <whatever string variable contains the first word of your text> with the name of that variable.)