本文介绍了在iphone编程中@property,@synthesize,@ implementation,@ interface是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone编程的新手,想知道:

I am new to iPhone programming, and want to know:

在iPhone编程中@property,@synthesize,@ implementation,@ interface是什么?

What are @property, @synthesize, @implementation, @interface in iPhone programming?

推荐答案

@property为getter和setter方法生成原型。您通常将其放在@interface块中,该块本身位于.h文件中。 @interface块是您声明对象的方法和属性的地方。

@property generates prototypes for getter and setter methods. You usually place it in an @interface block which is itself in a .h file. The @interface block is where you declare a object's methods and attributes.

@synthesize生成getter和setter方法。您通常将它放在@implementation块中,该块本身位于.m文件中。 @implementation块是您编写对象方法代码的地方。

@synthesize generates getter and setter methods. You usually place it in an @implementation block which is itself in a .m file. The @implementation block is where you write the code of the object's methods.

这篇关于在iphone编程中@property,@synthesize,@ implementation,@ interface是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 18:26