开发者

Property 'xxx' not found on object of type 'yyy'

开发者 https://www.devze.com 2023-04-13 02:44 出处:网络
I upgraded to xcode 4.0 and am now getting this error when I compile: \"Property \'xxx\' not found on object开发者_JS百科 of type \'yyy\'\"

I upgraded to xcode 4.0 and am now getting this error when I compile:

"Property 'xxx' not found on object开发者_JS百科 of type 'yyy'"

where xxx is a property and yyy is my delegate.

I'm trying to set the property xxx on the delegate object as follows:

self.delegate.xxx=@"abc"

Does anyone know why this would not be working now with xcode 4.0? It was fine with xcode 3.x.

I'm also getting this compile error:

"Expression is no assignable - type of receiver is unknown"


I'm guessing your delegate is of type id? If so, the compiler doesn't have enough information to safely let you do this. You need to cast your delegate to a type that is expecting to have a property xxx. I also find . notation more warning-prone. Maybe something like this:

[(YourObj *)self.delegate setXXX:@"abc"];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号