我不知道这段代码有什么问题,但每当我运行应用程序时,在显示菜单后,应用程序崩溃.
NSString * path = [[NSBundle mainBundle] pathForResource:@"tung" ofType:@"doc"];
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
docController.delegate = self;
//[docController presentPreviewAnimated:YES];
CGRect rect = CGRectMake(0, 0, 300, 300);
[docController presentOptionsMenuFromRect:rect inView:self.view animated:YES];
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
***由于未捕获的异常'NSGenericException'终止应用程序,原因:' - [UIPopoverController dealloc]到达,而popover仍然可见.
我现在应该怎么做 ?
我用我的屏幕(桌面)捕获软件创建了.mov视频文件,我想在UIWebview中的应用程序中播放该视频.有没有办法播放该视频或任何其他方式,以便我可以为我的本地视频创建一个URL ???
现在我使用默认视频链接在UIWebview中播放视频.
这是代码:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
self.viewVideoDisplay.frame = CGRectMake(0, 0, 1024, 1024);
[self.window addSubview:self.viewVideoDisplay];
[self.window bringSubviewToFront:self.viewVideoDisplay];
NSString *urlAddress = @"https://response.questback.com/pricewaterhousecoopersas/zit1rutygm/";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[self.webViewVideo loadRequest:requestObj];
IsLoadingSelf = YES;
}
Run Code Online (Sandbox Code Playgroud)
但是我没有想要播放的视频网址..
请帮助!!
我似乎与许多发布在这里的人有相反的问题MKMapView.我似乎无法让它停止这样做,而不是无法让它缩放并显示当前位置.这是发生的事情:
我试图告诉我CLLocationManager到stopUpdatingLocation(没有任何影响,因为一个MKMapView知道如何使用CoreLocation),我尝试了告诉MKMapView给setShowsUserLocation:NO(无蓝点显示在所有的,这不是我想要的).我甚至试图消除我的CLLocationManager(没有效果).造成这种情况的原因是什么?如何阻止它?
是的,我确实设置了位置管理员的准确性和距离-loadView.
我没有实施-mapViewDidFinishLoadingMap:.这是我的实施
-locationManager:didUpdateToLocation:fromLocation:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
// How many seconds ago was this new location created?
NSTimeInterval t = [[newLocation timestamp] timeIntervalSinceNow];
// CLLocationManagers will return the last found location of the device first,
// you don't want that data in this case. If this location was …Run Code Online (Sandbox Code Playgroud) 有人能告诉我为什么每次评估都是真的吗?!
输入是:jkhkjhkj.我输入的phone字段并不重要.它每次都是真的......
NSRange range = NSMakeRange (0, [phone length]);
NSTextCheckingResult *match = [NSTextCheckingResult phoneNumberCheckingResultWithRange:range phoneNumber:phone];
if ([match resultType] == NSTextCheckingTypePhoneNumber)
{
return YES;
}
else
{
return NO;
}
Run Code Online (Sandbox Code Playgroud)
这是值match:
(NSTextCheckingResult *) $4 = 0x0ab3ba30 <NSPhoneNumberCheckingResult: 0xab3ba30>{0, 8}{jkhkjhkj}
Run Code Online (Sandbox Code Playgroud)
我正在使用RegEx,NSPredicate但我已经读过,因为iOS4建议使用,NSTextCheckingResult但我找不到任何好的教程或示例.
提前致谢!
在我的应用程序中,我使用Log4j进行日志记录.目前我将log4j.xml放在WEB-INF/classes中.以下是我用来加载log4j.xml文件的配置.
<!-- language: xml -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)
现在我需要将log4j.xml文件放在war文件之外.该位置很可能是JBOSS_HOME/server/default/deploy/settings.在设置目录中,我需要放置我的log4j.xml.
我尝试通过编辑run.bat设置jboss类路径加载它,如下所示设置JBOSS_CLASSPATH =%RUN_CLASSPATH%;%JBOSS_HOME%\ server\default\deploy\settings我在web.xml下面使用
<!-- language: xml -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:/log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)
但它在部署应用程序时抛出异常.例外是
java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: class path resource [/log4j.xml] cannot be resolved to URL because it does not exist
现在我的问题是如何加载它.
以下是我的代码,用于滚动UILabel水平,使其显示为选框效果.但是动画开始于标签位于中心并滚动直到它的宽度,并再次从中心滚动统计数据.我想要从左到右连续滚动字幕.任何身体都可以帮助我.
-(void)loadLabel{
if (messageView) {
[messageView removeFromSuperview];
}
NSString *theMessage = text;
messageSize = [theMessage sizeWithFont:font];
messageView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 916)]; //x,y,width,height
[messageView setClipsToBounds:NO]; // With This you prevent the animation to be drawn outside the bounds.
[self.view addSubview:messageView];
lblTime = [[RRSGlowLabel alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 916)]; //x,y,width,height
[lblTime setBackgroundColor:[UIColor yellowColor]];
lblTime.font = font;
[lblTime setText:theMessage];
lblTime.glowOffset = CGSizeMake(0.0, 0.0);
lblTime.glowAmount = 90.0;
lblTime.glowColor = color;
[lblTime setClipsToBounds:NO];
[lblTime setTextColor:color];
[lblTime setTextAlignment:UITextAlignmentLeft];
lblTime.frame = messageView.bounds ; //x,y,width,height …Run Code Online (Sandbox Code Playgroud) GET方法,它工作正常.
网址:http://myurl.com/test.html?query = id = 123& name = kkk
我没有POST方法的概念.请帮我.
我如何将GET方法转换为POST方法?
网址:http://testurl.com/test.html
[urlRequest setHTTPMethod:@"POST"];
有没有人有任何好的例子来解释NSAffinetransform和CGAffinetransform?之间的区别?谢谢
我是这个主题的新手,需要在我的应用程序中实现Apple推送通知的一些指导.我创建了我的appID,并为此同时配置了Apple推送通知.我已下载配置文件并在iphone上安装了该应用程序.我还编写了Apple文档提供的以下代码
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken
{
const void *devTokenBytes = [devToken bytes];
NSLog(@"devToken=%@",devTokenBytes);
//self.registered = YES;
//[self sendProviderDeviceToken:devTokenBytes]; // custom method
}
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
{
NSLog(@"Error in registration. Error: %@", err);
}
Run Code Online (Sandbox Code Playgroud)
我想知道我必须在服务器端写什么.当我运行代码时,它表示设备未注册.如何注册推送通知的应用程序.
谁能帮我这个...
任何代码都会非常有用......
提前完成了...
我是iPhone开发人员的新手,
我想一个接一个地实现2个警报视图,比如当用户按下删除按钮时,第一个警报视图会询问Are you sure want to Delete ?两个按钮yes和no
现在,如果用户按下yes,则第二个警报视图将显示消息Deleted Successfully !此警报视图仅包含OK按钮,现在单击此OK按钮我想调用一个方法.
如果用户按下No则不会发生任何事情,警报应该解除.
这是我的代码片段,
-(void)DeletebtnCliked:(id)sender
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Are you sure want to delete ?"
message:nil delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Yes",@"No",nil];
[alertView show];
[alertView release];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
UIAlertView* alertew = [[UIAlertView alloc] initWithTitle:@"Deleted Successfully !"
message:nil delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertew show];
[alertew release];
if (buttonIndex == …Run Code Online (Sandbox Code Playgroud) iphone ×8
objective-c ×4
ios ×3
ipad ×2
buttonclick ×1
cocoa-touch ×1
document ×1
ios5 ×1
location ×1
log4j ×1
marquee ×1
mkmapview ×1
nsurlrequest ×1
post ×1
uialertview ×1
uilabel ×1
uiwebview ×1
validation ×1
video ×1
zooming ×1