Try to understand the code. componentsSeparatedByString
creates an array of smaller strings that are separated by &user_id=
. This means, the output for you would be:
Array of ["https://oauth.vk.com/blank.html#access_token=b1b33dfaa3&expires_in=86400", "311515"]
Now you see why the lastObject
gets you the value of user_id
. Now try to use the same methods to get the value of access_token
.
Hint: you need to set &
as the separator.