我正在嘗試使用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我試了兩個它不會改變。 –
咦?兩者是什麼? –