what\'s this line mean when using the second NSDictionay beside the message body:
NSDictionary *item = (NSDictionary *) [self.content objectAtIndex:indexPath.row];
This is a cast, as in C.
In your case, "self.content" seems to be an NSArray. So [self.content objectAtIndex:indexPath.row] would be an NSObject. Except that here, for some reason, you know it's an NSDictionary. So you explicitly cast it in order to avoid a compiler warning (that would tell you "hey, you're assigning an NSObject to an NSDictionary variable)
self.content
is a property of type NSArray
(I guess!)
This line returns you the Object (which seams to be a NSDictionary
) at Index indexPath.row
. (NSDictionary*)
casts the object to NSDictionary
.
(NSDictionary *)
a type cast. It tells the compiler to assume that the object returned by the objectAtIndex:
method is of the type NSDictionary *
even though the return type of the method is different.