我正在尝试使用makeObjectsPerformSelector
方法。无法识别的选择器设置为实例
这是我的代码。 我不明白为什么当我打电话makeObjectsPerformSelector
有选uppercase:
它没有找到它...
#import "testAppViewController.h"
@interface testAppViewController()
- (void)uppercase;
@property (nonatomic, strong) NSMutableArray *arrayTest;
@end
@implementation testAppViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self start];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)uppercase
{
NSLog(@"---");
}
- (void) start
{
self.arrayTest = [[NSMutableArray alloc] init];
[self.arrayTest addObject:@"toto"];
[self.arrayTest addObject:@"tata"];
[self.arrayTest addObject:@"titi"];
[self.arrayTest addObject:@"tutu"];
for (NSString *s in self.arrayTest)
NSLog(@"1 - %@", s);
[self.arrayTest makeObjectsPerformSelector:@selector(uppercase)];
for (NSString *s in self.arrayTest)
NSLog(@"2 - %@", s);
}
难道是因为有对'NSString'没有这样的方法? –
@JoshCaswell我试了两个它不会改变。 –
咦?两者是什么? –