Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
NSURL でパラメーターを渡したい。たとえば、私は
NSURL *url = [NSURL URLWithString:@"http://demo.digi-corp.com:82/Nilesh/betBuddy/api/getEventsXML.php?sp_ID=2"];
どこsp_IDで 1、2、3、4 などを指定できますか。どうすればよいですか? 私を助けてください。
sp_ID
メソッド [NSString stringWithFormat:@""] を使用して、URL 文字列をフォーマットできます。例えば、
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://e.com/?var=%d", 2]];
文字列フォーマット指定子のドキュメントを見ると、置換の各タイプ (integer、double、object など) に使用する文字を正確に見つけることができます。