sometimes its the simple things that take the most time

I’m really enjoying Objective-C but I still have a lot to learn. And it never ceases to amaze me how quickly I can get stuck on simple things. I just spent the last hour or so trying to concatenate an NSString pulled from an NSDictionary with another NSString value. Simple right? Well I kept getting compiler issues regardless of what I tried, and I finally realized that I needed to cast the value coming from the NSDictionary as an NSString. The solution ended up being the following:

    NSString *thumbnailPath = [(NSString *)[currentAbbreviation objectForKey:@"currentImageFilePath"] stringByAppendingString:@"thumb"];

It makes logical sense but wow. What a pain figuring it out. But hey, now I have a few more pieces to the puzzle 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s