Flickr Assignment Problems

Skip to first unread message

Jeffrey Lee

May 13, 2012, 7:39:42 PM5/13/12
I'm struggling a bit with assignment 4. I'm pulling the content value from the description dictionary for the description. Often, it comes back as blank, yet, I test for nil and "" in order to replace blanks with "Unknown", but that test never returns as true. What other sort of blank could be returned?
Jeffrey Lee

David Barton

May 14, 2012, 3:41:51 AM5/14/12


I am using the following code snippet, which seems to work I think…./

// Get a handle to the photo's title and description

NSString *photoTitle = [photosInPlace objectForKey:TITLE_KEY]; 

NSString *photoDescription = [photosInPlace valueForKeyPath:DESCRIPTION_KEY];

// If the photo title is available set the cell's title to photoTitle and the cell's 

// subtitle to the photo description

if (photoTitle && ![photoTitle isEqualToString:@""]) {

cell.textLabel.text = photoTitle;

cell.detailTextLabel.text = photoDescription;

// else if the photo description is available set the title equal to it

} else if (photoDescription && ![photoDescription isEqualToString:@""]) { 

cell.textLabel.text = photoDescription;

cell.detailTextLabel.text = @"";

// else set the title to Unknown

} else {

cell.textLabel.text = @"Unknown";

cell.detailTextLabel.text = @"";


Are you using isEqualToString do to the comparison?

Jeffrey Lee

May 14, 2012, 9:18:25 AM5/14/12

No, I was doing a straight comparison, which probably checks if the objects are the same objects, vs. if they contain the same values.

Jeffrey Lee

You received this message because you are subscribed to the Google Groups "iPhone Application Development Auditors" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply all
Reply to author
0 new messages