swift - iOS Deprecated dataWithContentsOfMappedFile replacement -


this line of code:

let pkcs12data = nsdata.datawithcontentsofmappedfile(path!) 

is showing warning in xcode 7:

'datawithcontentsofmappedfile' deprecated in ios 8.0: use +datawithcontentsofurl:options:error: , nsdatareadingmappedifsafe or nsdatareadingmappedalways instead. 

but when try of suggested, can't find methods responding suggested. idea?

thanks...

should used init method:

let pkcs12data = nsdata(contentsofurl: url, options: options, error: &error) 

if using swift 2.x should wrap try-statement.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -