Question: For my current project, I need to drop some pins on a image(NOT a map), and also should be able to click the pin to add some comments to this pin. I wonder if I can use MKAnnotation/MKAnnotationView to do this. I have searched on Internet for a while. I only find tutorials about how to customize MKAnnotation with other images. 

If I cannot use MKAnnotation, what should I use? Any tutorials about this will be great helpful.

Thanks.

Answer: 
Finally I found that when I want to read attribute user.MYATTR, i have to use name MYATTR. 

I just wanna mention what interesting behaviour I found, that may lead to mystakes and i wanna warn you :)

My file has these two attributes:

user.MYATTR1
user.somethingElse.MYATTR2

When I was listing attributes using view.list() method I saw only this one (without user.):
MYATTR1

when i wanna read attribute value, i have to use name of attribute without 'user.', so for mentioned attributes it is:
MYATTR1
or
somethingElse.MYATTR2
Did you read the [docs](http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/UserDefinedFileAttributeView.html) to the class `UserDefinedFileAttributeView`?

Reading carefully gives a few hints, why your code doesn't work properly.

For example you can check that:

> 
> ... This *FileAttributeView* is not intended for use where the size of an
>  attribute value is larger than [Integer.MAX\_VALUE](http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#MAX_VALUE) ...
> 
> 
> 

or check, if you have a security manager installed:

> 
> ... in the case of the default provider at least, all methods that
>  access user-defined attributes require the
>  *RuntimePermission("accessUserDefinedAttributes")* permission when a
>  security manager is installed. ...
> 
> 
> 

Or try out another method to get an attribute:

> 
> ... Where dynamic access to file attributes is required, the
>  [getAttribute](http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getAttribute%28java.nio.file.Path,%20java.lang.String,%20java.nio.file.LinkOption...%29) method may be used to read the attribute value. The attribute value is returned as a byte array (byte[]). ...
> 
> 
> 

Maybe any of the hints helps you, good luck! :-)

**EDIT**

Here's an example code, which checks, if your file system provides user defined file attributes and prints them (on succes):

```
Path file = Paths.get("filename.ext");

// check that user defined attributes are supported by the file system
FileStore store = file.getFileStore();
if (!store.supportsFileAttributeView("xattr")) {
    System.err.format("UserDefinedFileAttributeView not supported on %s\n", store);
    System.exit(-1);

}
UserDefinedFileAttributeView view = file.getFileAttributeView(UserDefinedFileAttributeView.class);

// list user defined attributes
if (args.length == 1) {
    System.out.println("    Size  Name");
    System.out.println("--------  --------------------------------------");
    for (String name: view.list()) {
        System.out.format("%8d  %s\n", view.size(name), name);
    }
}

```

Full source code [here](http://www-inf.int-evry.fr/cours/java/javatutorial/essential/io/examples/Xdd.java) linked from [this page](http://www-inf.int-evry.fr/cours/java/javatutorial/essential/io/fileAttr.html#user) your question code is from ;-)