On Jun 22, 2008, at 09:46, William Squires wrote:

Okay, thanks. It seems to work if I just typecast it to NSString *, since the values are coming from an NSTextField as [textField stringValue] in my AppController.m when the action is triggered from the "Add" buttton.


Just typecasting isn't really the answer to your underlying worry here. After all, if your are passed an object that isn't a NSString, typecasting it won't help you.

If your implementation of tableView:setObjectValue:forTableColumn:row expects the value to be a string, it would be better to check if it isKindOfClass:[NSString class], and assign it to a NSString* local variable (no cast actually needed) if it is, or handle the error if it's not.


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to