Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-02-2009, 11:41 AM   #3 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

In this case you already have one cast, but I think it's casting to the wrong class. If bookmarkDict is full of strings, then your loop should be:

Code:
for (NSString *entry in bookmarkDict)
Casting is the way to go in situations like this, when dealing with arrays and dictionaries. The compiler has no idea what type of object is in an array or dictionary, so you need to help it out.

There are other situations where casting would be wrong. I can create and NSString and cast it as a UIView, but that won't make it respond to the right messages for a UIView. It doesn't actually do any "conversion" on the object.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,558
Threads: 89,129
Posts: 380,269
Top Poster: BrianSlick (7,105)
Welcome to our newest member, thesooty
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:27 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.