я хочу вызвать метод «шоу()», но почему я получаю сообщение об ошибке, что «ожидается идентификатор или (» и «использование необъявленной себя идентификатор»вызов метода из того же класса в Xcode
ViewController. м
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
NSDictionary *inventory;
}
- (void)shows;
@end
ViewController.m
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
inventory = @{@"Rahul":[NSNumber numberWithInt:11],
@"iOS":[NSNumber numberWithInt:22]};
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)shows
{
NSLog(@"%@",inventory);
}
[self shows];
@end
вот скриншот ошибки HTTP: //screencast.com/t/DR604TYpBF – Dalvik
звонок ** [самовыражения]; ** внутри любого метода –
я не понял. Я должен сделать другой метод? – Dalvik