code for ios works now for relative path, not working for / yet