Re: A documentation dumdum
Re: A documentation dumdum
- Subject: Re: A documentation dumdum
- From: Quincey Morris <email@hidden>
- Date: Sun, 22 Jun 2008 12:44:16 -0700
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@hidden)
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:
This email sent to email@hidden