对于iOS6,开发人员可以利用哪些新功能?
具体来说,我对用户位置服务感兴趣.
例如,在iO6演示中,它表示当用户拒绝拨打电话时,他们可以选择在他们开始工作时收到通知.
这是否意味着iOS6中的GPS服务始终开启?在iOS5中,当应用程序(例如高亮显示)请求对位置服务进行全时访问时(即使它们退出),GPS仍保持打开状态,但它会耗尽电池电量.
我有以下方法,我试图确定某人与练习有关.来自C#这似乎是正确的方法,但我在这里得到一些警告/错误.
- (BOOL) isAvailablePractice:(NSString*)practiceId
{
BOOL *check = NO;
for(NSUInteger i = 0; i < [self.practices count]; i++)
{
EHRXOption *o = [self.practices objectAtIndex:i];
if([o.id isEqualToString:practiceId])
check = YES;
}
return check;
}
Run Code Online (Sandbox Code Playgroud)
在线上我设置check = YES我收到以下警告
Incompatible integer to pointer conversion assigning to 'BOOL *' (aka 'signed char *') from 'signed char';
Run Code Online (Sandbox Code Playgroud)
在返回检查我得到此错误
Incompatible pointer to integer conversion returning 'BOOL *' (aka 'signed char *') from a function with result type 'BOOL' (aka 'signed char'); dereference with *
Run Code Online (Sandbox Code Playgroud)
我理解这个错误的方式,我可能是错的,如果我在返回*前面放一个*检查它实际上会返回一个新值而不是我一直在使用的那个.
我真的不明白Objective …
我似乎无法找到一个在iOS 6应用程序中使用地图的体面教程.我得到了添加MapView的部分,但我想在自定义位置添加引脚.我希望我的图钉左侧有标题,副标题和图片.我不确定我是否需要一个不适合的自定义引脚.我还想要一个细节披露指标来转到另一个页面.应该是那么复杂,但我不知道从哪里开始.请帮忙!
这不是一个重复的问题.尚未提供最终工作解决方案.在我接受答案或找到并提供我自己的解决方案之前,请不要关闭此问题.谢谢!
================================================== ================使用Xcode 4.5.1,我有一个标签栏应用程序,里面有5个标签.每个选项卡都包含一个UINavigationController.因此,整个应用程序需要在纵向模式下查看,除了一个唯一的ViewController - 一个"模态"VC,它以全屏模式打开,并且打算在横向模式下查看.
这在iOS5中运行得非常好 - 我只是在一个特定的ViewController中使用了以下代码:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Run Code Online (Sandbox Code Playgroud)
但现在应用程序崩溃了,并给出了这个错误:
Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation',
reason: 'preferredInterfaceOrientationForPresentation must return a supported interface orientation!'
Run Code Online (Sandbox Code Playgroud)
有什么建议?
基于开源项目cocos2d编写一些代码来实现弹跳球是如此容易,这就是问题所在.
所以没有cocos2d,如何用最简单的代码实现它.
问题是这样的:
我做了以下事情:
.plist背景模式是audio.didFinishLaunchingWithOptions[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error];
[[AVAudioSession sharedInstance] setActive:YES error:&error];
Run Code Online (Sandbox Code Playgroud)
我缺少什么?我检查了这error两种nil方法之后。
我有这个代码适用于iOS5,但我只是测试
NSDate *now = [NSDate date];
NSString *strDate = [[NSString alloc] initWithFormat:@"%@",now];
Run Code Online (Sandbox Code Playgroud)
有没有人知道重写这个的简单解决方案.日期格式应为dd mm yyyy
我在iOS 6上开发需要访问AddressBook的应用程序,我使用以下代码:
NSMutableArray *contacts = [[NSMutableArray alloc]init];
CFErrorRef *error = nil;
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, error);
if (error)
{NSLog(@"ERROR!!!");}
NSArray *arrayOfPeople = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addressBook);
Run Code Online (Sandbox Code Playgroud)
但在实际设备上,ArrayOfPeople是空的......为什么会这样?PS授予对AddressBook的所有访问权限
我是iPhone的新手请告诉我在tableview中有人使用dequeuereusablecellwithidentifier.还告诉我不使用dequeuereusablecellwithidentifier如何在tableview中创建单元格?
这是我的崩溃日志.
2012-09-24 00:06:16.711 DMJ[10021:c07] -[DMJAppDelegate application:supportedInterfaceOrientationsForWindow:]: unrecognized selector sent to instance 0x84abe70
2012-09-24 00:06:16.713 DMJ[10021:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DMJAppDelegate application:supportedInterfaceOrientationsForWindow:]: unrecognized selector sent to instance 0x84abe70'
*** First throw call stack:
(0x2553012 0x1e04e7e 0x25de4bd 0x1e187ea 0x2542cf9 0x254294e 0x82a332 0x91266d 0x90d046 0x90d246 0x85601f 0x476e8e 0x4769b7 0x875573 0x4a1428 0xa420cc 0x1e18663 0x254e45a 0xa40bcf 0xa4298d 0x824ceb 0x825002 0x823ed6 0x835315 0x83624b 0x827cf8 0x2c88df9 0x2c88ad0 0x24c8bf5 0x24c8962 0x24f9bb6 0x24f8f44 0x24f8e1b 0x8237da 0x82565c 0x2ded 0x2d25 0x1)
libc++abi.dylib: terminate called throwing an …Run Code Online (Sandbox Code Playgroud) 我已经在应用程序的几个版本中使用了这个简单的代码,直到iOS 6字符串比较已经有效,但现在它失败了 - 为什么?
if(selectedCell.textLabel.text==@"Font"){
NSLog(@"going to dofontpicker");
[self doFontPicker];
}else if(selectedCell.textLabel.text==@"Color"){
NSLog(@"going to do colorpicker");
[self doColorPicker];
}
Run Code Online (Sandbox Code Playgroud) ios6 ×11
ios ×7
objective-c ×4
iphone ×3
ios5 ×2
avfoundation ×1
boolean ×1
crash ×1
gps ×1
location ×1
map ×1
mkmapview ×1
nsdate ×1
orientation ×1
selector ×1
uitableview ×1