小编Raz*_*iel的帖子

目标C:类中get-methods的问题

我有一些课:

@interface SearchBase : NSObject
{
    NSString *words;
NSMutableArray *resultsTitles;
NSMutableArray *resultsUrl;
NSMutableArray *flag;
}

@property (copy, nonatomic) NSString *words;

- (id) getTitleAtIndex:(int *)index;
- (id) getUrlAtIndex:(int *)index;
- (id) getFlagAtIndex:(int *)index;
@end

@implementation SearchBase
 - (id) initWithQuery:(NSString *)words 
{
if (self = [super init])
{
    self.words = words;
}
return self;
}
- (id) getTitleAtIndex:(int *)index
{
return [resultsTitles objectAtIndex:index];
}

- (id) getUrlAtIndex:(int *)index
{
return [resultsUrl objectAtIndex:index];
}

- (id) getFlagAtIndex:(int *)index
{
return [flag objectAtIndex:index];
} …
Run Code Online (Sandbox Code Playgroud)

pointers objective-c parameter-passing

0
推荐指数
1
解决办法
116
查看次数

标签 统计

objective-c ×1

parameter-passing ×1

pointers ×1