开发者

how can i create a property for array of labels in an iphone app

In my iphone app i am programmatically creating the labels ,,i am creating array of labels like UILabel *lblVersionName[20]; i need to copy the contents of the label into some string so i need to define property like

@property(nonatomic,retain)UILabel *lblVersionName[20];

but its giving error that "property can not have array of function type lblVersi开发者_如何学JAVAonName[20]"

cant we have property for array of labels(lblVersionName[20]) please somebody do help me, thanx in advance


Instead of C array just use NSArray or NSMutableArray


From the documentation:

Supported Types

You can declare a property for any Objective-C class, Core Foundation data type, or “plain old data” (POD) type

So you're trying to add a property for an unsupported type.

Like Terente wrote, you should use NSArray or NSMutableArray.

You might have a reason for why you need a c array, but that is only going to cause you a lot of trouble down the road. Don't fight the frameworks.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜