Re: Incompatible pointer type from NSManagedObject's validateValue:forKey:error method
Re: Incompatible pointer type from NSManagedObject's validateValue:forKey:error method
- Subject: Re: Incompatible pointer type from NSManagedObject's validateValue:forKey:error method
- From: Cameron Hayne <email@hidden>
- Date: Sun, 22 Jan 2006 18:52:46 -0500
On 22-Jan-06, at 5:55 PM, email@hidden wrote:
warning: passing argument 1 of 'validateValue:forKey:error:' from
incompatible pointer type
if ([location validateValue:tempCDATA forKey:@"name" error:&error])
{ // warning here
[...]
This happens if the tempCDATA is an NSString, NSNumber, or id.
Looking in the NSManagedObject docs, I see that the signature of that
method is:
- (BOOL)validateValue:(id *)value forKey:(NSString *)key error:
(NSError **)error
which shows that the first argument is supposed to be of type (id *)
i.e. a pointer to an object, not an object itself.
So you likely need to put an ampersand (&) in front of the object
variables when you invoke this method:
[location validateValue:&tempCDATA forKey:@"name" error:&error]
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden