开发者

create a new object

开发者 https://www.devze.com 2023-03-07 23:48 出处:网络
I want to create a new object so as to instantiate and use it several times; For example, if I want to create an object that has a label and a button inside, how do I? I created a new NSObject 开发者

I want to create a new object so as to instantiate and use it several times;

For example, if I want to create an object that has a label and a button inside, how do I? I created a new NSObject 开发者_Go百科but inside it has nothing, then how do I make everything from scratch since there was a viewDidLoad for example (obviously, since it has a view)?

thanks!


Your questions lead me to think that you're really just starting out. There's nothing wrong with that, but rather than trying to summarize several megabytes of documentation in a few paragraphs, I'm just going to point you to the iOS Starting Point. I think that you're just trying to create a container that can hold other UI components? If so, use a UIView for that. However, don't jump in and try to get something specific done without first reading through some of the Getting Started documents -- you'll just end up back here, and we'll just point you back to the docs. You might like the Your First iOS Application guide, as that lets you get your feet wet but explains things along the way.

0

精彩评论

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

关注公众号