UIPickerView数据源&代表:错误

时间:2015-09-26 04:49:44

标签: swift delegates swift2 datasource uipickerviewcontroller

我不确定为什么会这样?

因为在其他项目中,使用相同的线条,它完美地运作。

enter image description here

1 个答案:

答案 0 :(得分:1)

检查@IBOutLet名为market

self.market.datasource = self self.market.delegate = self

只需用

更改名称即可
UIPickerView

检查#include <iostream> #include <string> #include <limits> int main() { char option; const char sentinel = 'q'; bool quit = false; for(int count = 0; count <= 20 && !quit; count++) { std::string name; bool invalid; do { invalid = false; // Display menu std::cout << "Welcome to the forum.\n"; std::cout << "Are you:\n"; std::cout << "1. A new member\n"; std::cout << "2. An existing member\n"; std::cout << "To exit press '" << sentinel << "'\n"; std::cin >> option; switch(option) { case '1': std::cout << "You're a new member.\n"; std::cout << "Please enter your first name followed "; std::cout << "by your last name.\n"; std::cout << "Then press return.\n"; std::cin >> name; break; case '2': std::cout << "You're an existing member.\n"; break; case sentinel: quit = true; break; default: std::cout << "You entered invalid input!\n\n"; std::cin.clear(); std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); invalid = true; continue; } } while(invalid); } std::cout << "Exiting...\n"; return 0; } 的声明名称。