r/ObjectiveC • • Oct 24 '19
Adding an integer value in NSURLQueryItem
This is the code that I am working on. The value for the pageSize is an integer. But I cannot find a way to pass anything else other than a String in that function. How can I pass that integer value?
Also, is the last line the correct syantx to put the query items together? while puttingtogether the query items together
NSURLQueryItem *country = [NSURLQueryItem queryItemWithName:@"country" value:@"us"];
NSURLQueryItem *page = [NSURLQueryItem queryItemWithName:@"pageSize" value:@"100"];
components.query = [country, page];
4
Upvotes
View all comments
Show parent comment
1
u/mulle_nat Nov 11 '19
You probably didn't use queryItems as I wrote, because that's an NSArray.