How can I get the filename of a shared object in iOS extension?

How can I get the filename of a shared object in iOS extension in Objective C?

my code that do not work

[itemProvider loadItemForTypeIdentifier:(NSString *)kUTTypeContent options:nil completionHandler:

^(NSURL *item, NSError *error)

{ NSURL* theUrl = (NSURL*) item;

NSLog([NSString stringWithFormat: @"configureAnyInfo02ForItemProvider theUrl %@" , theUrl]);

/ NSString * theFileName = theUrl.lastPathComponent; if (item) { [[NSOperationQueue mainQueue] addOperationWithBlock:^{ label.text = item; }]; }

}];



swift code


itemProvider!.first!.loadItemForTypeIdentifier(kUTTypeImage as String, options: nil, completionHandler:

{ (provider, error) in let url = provider as! NSURL println(url)

let data = NSData(contentsOfURL: url)

let name = url.lastPathComponent! ... /

self.extensionContext!.completeRequestReturningItems([], completionHandler: nil) })


what type is provider in that topic?

How can I get the filename of a shared object in iOS extension?
 
 
Q