我正在尝试以编程方式向我的应用程序导航栏添加信息按钮。然而,它从来没有触发我注册的操作。
UIBarButtonItem* infoButton =[[UIBarButtonItem alloc] initWithCustomView:[UIButton buttonWithType:UIButtonTypeInfoLight]];
[infoButton setTarget:self];
[infoButton setAction:@selector(infoButtonTapped)];
按钮出现在我的导航栏中,但点击它不会传递到infoButtonTapped函数。