F# 如何在MonoTouch和F中使用自定义属性#
我想对F#和MonoTouch进行一些反思 给定以下代码片段:F# 如何在MonoTouch和F中使用自定义属性#,f#,xamarin.ios,F#,Xamarin.ios,我想对F#和MonoTouch进行一些反思 给定以下代码片段: type Field (aName : string) = inherit Attribute() member this.Name = aName [<Field("title")>] member this.Title with get() = title 可以工作,但它只返回一个对象数组 知道我做错了什么吗 问候 罗杰,问
type Field (aName : string) =
inherit Attribute()
member this.Name = aName
[<Field("title")>]
member this.Title with get() = title
可以工作,但它只返回一个对象数组
知道我做错了什么吗
问候
罗杰,问题解决了。将属性从Field重命名为FieldInfo,它就起作用了 问候 罗杰
reflection.GetCustomAttributes(typeof<Field>, false)
reflection.GetCustomAttributes(false)