新的iPhone 5显示器具有新的宽高比和新的分辨率(640 x 1136像素).
开发新的或已经过渡的现有应用程序到新屏幕尺寸需要什么?
我们应该记住什么使应用程序对于旧显示器和新的宽屏宽高比"通用"?
我有一个协议:
enum DataFetchResult {
case success(data: Data)
case failure
}
protocol DataServiceType {
func fetchData(location: String, completion: (DataFetchResult) -> (Void))
func cachedData(location: String) -> Data?
}
Run Code Online (Sandbox Code Playgroud)
通过示例实现:
/// An implementation of DataServiceType protocol returning predefined results using arbitrary queue for asynchronyous mechanisms.
/// Dedicated to be used in various tests (Unit Tests).
class DataMockService: DataServiceType {
var result : DataFetchResult
var async : Bool = true
var queue : DispatchQueue = DispatchQueue.global(qos: .background)
var cachedData : Data? = nil
init(result …Run Code Online (Sandbox Code Playgroud) Xcode 5帮助创建了企业ipa的plist描述符.Xcode 6(6A313)仅创建ipa.这是一个错误还是故意改变?如果是这样的话 - 退后一步的原因是什么?
如果我之前没有使用Xcode 5生成plist,我需要自己手动创建它.你知道任何有助于这个过程的自动工具吗?
我需要为NSAttributedString(Core Text)中的每个字符(字形)计算精确的边界框.在整理了一些用于解决类似问题的代码(核心文本选择等)之后,结果非常好,但只有少数帧(红色)正在被正确计算:

大多数帧都是水平或垂直错位(微小位).这是什么原因?我怎样才能完善这段代码?:
-(void)recalculate{
// get characters from NSString
NSUInteger len = [_attributedString.string length];
UniChar *characters = (UniChar *)malloc(sizeof(UniChar)*len);
CFStringGetCharacters((__bridge CFStringRef)_attributedString.string, CFRangeMake(0, [_attributedString.string length]), characters);
// allocate glyphs and bounding box arrays for holding the result
// assuming that each character is only one glyph, which is wrong
CGGlyph *glyphs = (CGGlyph *)malloc(sizeof(CGGlyph)*len);
CTFontGetGlyphsForCharacters(_font, characters, glyphs, len);
// get bounding boxes for glyphs
CTFontGetBoundingRectsForGlyphs(_font, kCTFontDefaultOrientation, glyphs, _characterFrames, len);
free(characters); free(glyphs);
// Measure how mush specec will be needed for this …Run Code Online (Sandbox Code Playgroud) 我需要Git命令来获取/找到以 'v' 开头的最后一个标签以获得最后一个版本控制提交(我在开头用v标签标记下一个应用程序版本(例如:v0.9.1beta).
有什么办法吗?
我的应用程序需要在后台跟踪用户位置更改,并且只要用户移动就可以正常工作.当用户CLLocationManager在10-20分钟左右停止并暂停时.此通知表明:
-(void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager{}
Run Code Online (Sandbox Code Playgroud)
这对我也没关系.太棒了,我节省了一些电池等
问题是CLLocationManager当用户再次开始移动时永远不会醒来,并且在我将应用程序放到前台之前永远不会触发委托方法(获取活动):
//Never called back after CLLocationManager pauses:
-(void)locationManagerDidResumeLocationUpdates:(CLLocationManager *)manager{}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{}
Run Code Online (Sandbox Code Playgroud)
为什么locationManagerDidResumeLocationUpdates在设备重新开始移动后从未调用过?GPS也不应自动恢复(因为自动暂停)?
有没有办法在没有用户互动的情况下恢复GPS?
应用程序在Info.plist文件中声明如下:

我的CLLocationManager设置是:
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager setActivityType:CLActivityTypeFitness];
//I WANT pauses to save some battery, etc... That is why following line is commented out (default)
//[locationManager setPausesLocationUpdatesAutomatically:NO];
locationManager.distanceFilter = kCLLocationAccuracyNearestTenMeters;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
[locationManager startUpdatingLocation];
Run Code Online (Sandbox Code Playgroud) objective-c core-location uiapplicationdelegate cllocationmanager ios
我已经将apk发布到Android Market,为所有国家/地区免费激活和设置.
Android Market说,我的应用程序与任何设备都不兼容.当我从PC浏览器访问Android Market时,我可以看到一个应用程序,但我无法从任何Android手机(用于在发布前测试应用程序的相同设备)下载它.
如果我的要求很少,那怎么可能呢?我已经在上传之前在一些相当旧的设备上测试了该应用程序并且它有效.
发布选项中的信息:
This application is only available to devices with these features, as defined in your application manifest.
Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
android.hardware.screen.portrait
android.hardware.touchscreen
*This application is available to over 0 devices.*
Run Code Online (Sandbox Code Playgroud)

APK标签上的信息:
VersionCode: 2
VersionName: 1.0.1
Size: 4.3M
Localized to: default
Permissions: android.permission.READ_PHONE_STATE, android.permission.INTERNET, android.permission.WRITE_EXTERNAL_STORAGE, android.permission.ACCESS_NETWORK_STATE
Features: android.hardware.screen.portrait, android.hardware.touchscreen
API level: 7-15+
Supported screens: small-xlarge
OpenGL textures: all
Run Code Online (Sandbox Code Playgroud)

如果它不够奇怪,我在同一个帐户有另一个应用程序,具有非常相似的要求,它给了我:这个应用程序可用于超过746个设备.
到底是怎么回事?
更新:
因为很多答案都表明:"只需激活你的APK ......"我再次强调: …
我需要检查用户位置是否属于MKCoordinateRegion.我很惊讶没有为此找到简单的功能,例如:CGRectContainsCGPoint(rect,point).
我找到了以下代码:
CLLocationCoordinate2D topLeftCoordinate =
CLLocationCoordinate2DMake(region.center.latitude
+ (region.span.latitudeDelta/2.0),
region.center.longitude
- (region.span.longitudeDelta/2.0));
CLLocationCoordinate2D bottomRightCoordinate =
CLLocationCoordinate2DMake(region.center.latitude
- (region.span.latitudeDelta/2.0),
region.center.longitude
+ (region.span.longitudeDelta/2.0));
if (location.latitude < topLeftCoordinate.latitude || location.latitude > bottomRightCoordinate.latitude || location.longitude < bottomRightCoordinate.longitude || location.longitude > bottomRightCoordinate.longitude) {
// Coordinate fits into the region
}
Run Code Online (Sandbox Code Playgroud)
但是,我不确定它是否准确,因为文档没有准确指定区域矩形的计算方式.
必须有更简单的方法来做到这一点.我是否忽略了MapKit框架文档中的某些功能?
在我的应用程序之一,当我尝试编辑(键入一些文本)UITextField,UITextView或其他任何"文本能够" UIControl光标只是闪烁,但没有字符被输入了退格键除外(可能只有当我有它的一些初始文本)返回和切换字符类型.这涉及整个应用程序的所有控件.
摘要:
UIAlertView呈现给用户,并驳回.如果此警报显示在同一屏幕(UIViewController视图)或任何其他屏幕上,则无关紧要.我不知道如何处理或调试它.
我应该在哪里寻找提示?跟踪响应者链相关问题的任何专家等?
如何追踪UIAlertView问题对这个问题的影响?
我在iPhone模拟器Xcode 4.6中运行我的iPhone项目后,每隔2或3次在" 在iPhone 6.1模拟器中运行"阶段挂起.是的,经常这样.
它几乎挂在我运行的每个项目和我的2台Mac机器上(Mac Mini 8GB,Core 2 Duo,SSD驱动器和MacBook Pro Core 2 Duo 3,1 Ghz,8BG RAM,SSD驱动器)
这也是之前Xcode中的问题,但它很少发生,可以容忍.
我需要重新启动我的Xcode和模拟器才能再次运行项目(有时甚至重启OS X).
除了重新启动Xcode解决它之外,是什么导致了这个以及我们还能做些什么? 为什么Apple在这么长时间内无法解决这个问题?
更新:
我被告知这个问题是不具有建设性的,我不同意,因为我的主要问题是:
是什么导致这种常规挂起? 苹果为什么没有解决这么长时间,这不是我的主要兴趣所在.
主要关注点仍然非常实用和技术性:这种常规功能失调的共鸣是什么?开发人员可以手动做些什么来帮助它?
毕竟:Xcode只是我们在工作中使用的工具,每一项可以提高生产力的知识都是有价值的.
更新2:
**重新安装到最新的Mac OS X Lion(干净安装)并安装最新的Xcode,iTunes,Safari,iPhone模拟器问题仍然存在.**这显然是Xcode或iPhone模拟器的错误.
ios ×6
iphone ×5
objective-c ×2
android ×1
cllocation ×1
closures ×1
core-text ×1
device ×1
enterprise ×1
find ×1
git ×1
glyph ×1
google-play ×1
hang ×1
ios6 ×1
ipad ×1
iphone-5 ×1
regex ×1
screen ×1
swift ×1
swift3 ×1
tagging ×1
tags ×1
uitextfield ×1
uitextview ×1
xcode ×1
xcode6 ×1
xcode8-beta6 ×1