开发者

Objective-C Alert .. not working?

开发者 https://www.devze.com 2022-12-15 09:10 出处:网络
For some reason my alert is not working? If i use NSLog(@\" %@ \", url) its fine... but no alert here:

For some reason my alert is not working? If i use NSLog(@" %@ ", url) its fine... but no alert here:

- (void)alertURL:(NSURL *)url {
UIAlertView *someError = [[UIAlertView alloc] initWithTitle: url message: @"Error sending your info to the server" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];

[someError show];
[someError release];
}

- (BOOL)application:(UIApplication *)applicat开发者_如何学Goion handleOpenURL:(NSURL *)url {
[self alertURL:url];
return YES;
}

Could anyone point out to me whats going wrong :(


You are passing the NSURL object as the title argument to the UIAlertView initializer.

The title argument expects an NSString which you clearly are not passing to it.

You need to call [ url absoluteString ] or [ url relativeString ] instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消