Hello.

I just wanted to check out NSBundle's + bundleFromURL. I looked in the documentation and said nothing about only some protocols working, so I thought I could load a bundle via HTTP which would be awesome, but that seemed to fail. Is this a bug, or am I being stupid?

Here is my code:

#import <Cocoa/Cocoa.h>

int main(int argc, char *argv[])
{
    NSAutoreleasePool* pool = [NSAutoreleasePool new];
    [NSApplication sharedApplication];
NSURL* url = [NSURL URLWithString:@"http://localhost/TestServer2.bundle "];
    NSBundle* bundle = [NSBundle bundleWithURL:url];
NSString* nib = [bundle objectForInfoDictionaryKey:@"NSMainNibFile"];
    [NSBundle loadNibNamed:nib owner:NSApp];
    [NSApp run];
    [pool drain];
    return 0;
}

and here are my errors:

2009-09-04 00:33:52.657 TestClient[90551:a0f] An uncaught exception was raised 2009-09-04 00:33:52.659 TestClient[90551:a0f] *** -[NSBundle initWithURL:]: non-file URL argument 2009-09-04 00:33:52.663 TestClient[90551:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** - [NSBundle initWithURL:]: non-file URL argument'

It doesn't seem to like the fact that the bundle URL is a directory, but what else would it be?!
(and yes I have a webserver, and yes the URL is correct)

- Fisk
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to