Objective-C Primer(3)Multiple arguments for one method, synthesize and dynamic

Objective-C Primer(3)Multiple arguments for one method, synthesize and dynamic

  • Author: 柳大·Poechant(钟超)
  • Email: zhongchao.ustc#gmail.com (# -> @)
  • Blog:Blog.CSDN.net/Poechant
  • Date: May 7th, 2012

1 How to declare a method with multiple arguments?


//
//  TestClass.m
//  ObjectiveCTest
//
//  Created by 超 钟 on 12-5-6.
//  Copyright (c) 2012年 http://blog.csdn.net/poechant. All rights reserved.
//

#import "TestClass.h"

@implementation TestClass

-(void)privateMethod2: (int)inArg1 arg2:(int)inArg2
{
    NSLog(@"private method 2");
}

-(void)someMethod;
{
    NSLog(@"some method got called");
    
    [self privateMethod1:1 
                    arg2:2 
                    arg3:3];
    
    [self privateMethod2:1
                    arg2:2];
}

@end

2 How to invoke a method with multiple arguments?

It’s similar to declare the method. Do you remember…



-(void)privateMethod1: (int)inArg1
                 arg2: (int)inArg2
                 arg3: (int)inArg3
{
    NSLog(@"private method 1");
}

3 What the difference between synthesize and dynamic?

synthesize seems better than dynamic because at this moment, you may think less is better. But your demands are not satisfied every time because of $.

-

转载请注明来自柳大的CSDN博客:Blog.CSDN.net/Poechant

-

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

钟超

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值