user3823935
user3823935

Reputation: 891

How to use NSMutableRequest in XCode6

Code:

var request = NSMutableURLRequest(URL: strURl, cachePolicy:NSURLRequestCachePolicy, timeoutInterval:60.0)

What is wrong with my code? How do I solve below error:

Expected member name or constructor call after type name

any help will be appreciated.

Upvotes: 0

Views: 210

Answers (1)

Mike S
Mike S

Reputation: 42355

NSURLRequestCachePolicy is an enum, you need to pick one of its values. You can get a list of them and what they do here.

For example, if you want to use the default cache policy, you'd do:

var request = NSMutableURLRequest(URL: strURl, cachePolicy:NSURLRequestCachePolicy.UseProtocolCachePolicy, timeoutInterval:60.0)

Upvotes: 2

Related Questions