直到昨天,Xcode的一切正常.它将模拟器显示为:

但是今天,当我打开它时,模拟器列表变为:

每个模拟器都可以看到两次,名称后面跟一个唯一的id.我还观察到同样名为Simulator的也是两个不同的实例.
任何人都可以帮助我,如何摆脱这个?或者如何重置它.它给人一种奇怪的外观.
任何建议都会有所帮助.
刚刚下载了Xcode 7 Beta,enumerate关键字出现了这个错误.
for (index, string) in enumerate(mySwiftStringArray)
{
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我克服这个吗?
而且,似乎count()不再适用于计算长度String.
let stringLength = count(myString)
Run Code Online (Sandbox Code Playgroud)
在上面一行,编译器说:
'count'不可用:访问集合上的'count'属性.
Apple已经发布了Swift 2.0的任何编程指南吗?
我尝试为UILabel获得随机颜色......
- (UIColor *)randomColor
{
int red = arc4random() % 255 / 255.0;
int green = arc4random() % 255 / 255.0;
int blue = arc4random() % 255 / 255.0;
UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
NSLog(@"%@", color);
return color;
}
Run Code Online (Sandbox Code Playgroud)
并使用它:
[mat addAttributes:@{NSForegroundColorAttributeName : [self randomColor]} range:range];
Run Code Online (Sandbox Code Playgroud)
但颜色总是黑色的.怎么了?
PS抱歉我的英文)
我有一个iPhone应用程序我正在更新到iOS 6有旋转问题.我有UITabBarController16岁UINavigationCotrollers.大多数子视图可以在纵向或横向上工作,但其中一些只是纵向.对于iOS 6,它们不应该旋转.
我尝试将supportedInterfaceOrienationstabBarController 子类化为返回当前navigationController的选定viewController:
- (NSUInteger)supportedInterfaceOrientations{
UINavigationController *navController = (UINavigationController *)self.selectedViewController;
return [navController.visibleViewController supportedInterfaceOrientations];
}
Run Code Online (Sandbox Code Playgroud)
这让我更接近.视图控制器在可见时不会旋转到位置,但如果我处于横向和切换选项卡中,即使不支持,新选项卡也将处于横向状态.
理想情况下,应用程序仅在当前可见视图控制器的支持方向上.有任何想法吗?
rotation uitabbarcontroller orientation uinavigationcontroller ios6
更新到XCode 6.3后,编译器开始发出此警告.
Comparison of address of 'myObject' not equal to null pointer is always true.
这是我的一段代码,

用它抓我的头,但没有找到任何解决方案或解决方法来摆脱这个警告.
我的问题与此处的问题有关.但是,使用所讨论的答案无法解决.
欢迎任何帮助:)
我有一个UIView包含按钮和标签.按下这些按钮时,UIView使用下面的代码会变得模糊.
@IBOutlet weak var blurView: UIView!
var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
var blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = blurView.bounds
blurView.addSubview(blurEffectView)
Run Code Online (Sandbox Code Playgroud)
但是,我想稍后删除模糊效果.删除模糊的代码是什么UIView?
在运行时,有没有办法CFBundleVersion从Info.Plist 读取?
我想在应用程序的"关于框"中显示版本信息.
提前致谢,
-ed
在控制器中,我们添加了观察者viewDidAppear并将其删除viewWillDisappear.没有观察员init/viewDidLoad.
在这种情况下,出于安全目的/下面的dealloc方法是否需要方法?
[[NSNotificationCenter defaultCenter] removeObserver:self];
Run Code Online (Sandbox Code Playgroud)
现在问题/疑问是有没有被调用dealloc而viewWillDisappear被调用的场景?什么时候调用内存警告.在那些情况下会发生什么?
谢谢.
我有一个为我的大学校园建立离线地图的想法(它覆盖了大约3-4英里).像新学生或客人可以导航到校园的各个街区.学生可以在当前位置看到他/她自己在地图上的标记,并且可以从预定义的地点列表中选择目的地,并且应用程序将导航他们.
我已经探索过很多像maptiles可以帮助我显示地图.但是有没有其他有效的方式来展示校园地图?我不知道我将如何导航用户(因为作为私人财产区域是Google的地图(或其他一些)API无法访问).
任何建议都会有所帮助.:)
EDITED
这是谷歌地图链接到我的地方.
我正在研究过去几天的ArcGIS,学习使用"ArcGIS for Desktop"创建"地理数据库",以便在iPhone上渲染离线地图.
但是,现在我关心的是如何导航用户.
我将欢迎任何使用任何不同方法完成它的建议/想法.
我想在iOS中使用VOYPI等应用程序中的相同功能.
在通话过程中播放背景音.
我在调用过程中使用了以下代码播放背景音.
参考应用程序的链接在这里.
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:self.bgAudioFileName ofType: @"mp3"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:soundFilePath ];
myAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
myAudioPlayer.numberOfLoops = -1;
NSError *sessionError = nil;
// Change the default output audio route
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
// get your audio session somehow
[audioSession setCategory:AVAudioSessionCategoryMultiRoute error:&sessionError];
BOOL success= [audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:&sessionError];
[audioSession setActive:YES error:&sessionError];
if(!success)
{
NSLog(@"error doing outputaudioportoverride - %@", [sessionError localizedDescription]);
}
[myAudioPlayer setVolume:1.0f];
[myAudioPlayer play];
}
Run Code Online (Sandbox Code Playgroud)
此代码将使用avaudioplayer在正在进行的运营商呼叫中播放地面声音.
我已经设置了类别AVAudioSessionCategoryMultiRoute. …
ios ×5
objective-c ×4
swift ×3
xcode ×2
info.plist ×1
ios6 ×1
ios8 ×1
iphone ×1
maps ×1
mbtiles ×1
orientation ×1
react-native ×1
rotation ×1
simulator ×1
swift2 ×1
uiblureffect ×1
uicolor ×1
uiview ×1
warnings ×1
xcode6 ×1