小编iWh*_*Buy的帖子

iPad上的空应用程序图标仅适用于iPhone应用程序

我有一个iPhone应用程序没有针对iPad工作进行优化,但它包含iPad的所有图标.当我在iPad上安装应用程序时 - 没有图标.此外,当我从iPad上的商店下载我的应用程序时 - 它没有图标......

在Xcode 9中,我将应用程序标记为"通用"并构建它.图标出现了!标记为"仅限iPhone" - 图标消失了.

所以问题是:如何制作一个"iPhone only"应用程序在iPad上有一个图标?

PS

使用提供和激活的iPad图标创建一些新图标无济于事

PS

清除和删除派生数据没有帮助

PS

我有一个iPad和iPad的图标,项目中选中了所有复标记.

我找到了原因:

<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
Run Code Online (Sandbox Code Playgroud)

这些行使info.plist图标集禁用.我不知道他们来自哪里......当我删除这些线条时 - 图标出现在iPad上.

感谢帮助!!!

iphone xcode app-store ipad ios

5
推荐指数
1
解决办法
1538
查看次数

Core Graphics/Quartz 2D图像调整大小崩溃

任务是调整图像大小.

我已经阅读了这篇文章并采用了CGBitmapContextCreate和CGContextDrawImage方法.这就是我的调整大小功能的样子:

extension UIImage {

    func with(maxHeight: CGFloat, maxWidth: CGFloat) -> UIImage? {
        guard let image = self.cgImage else {
            return nil
        }
        var height = CGFloat(image.height)
        var width = CGFloat(image.width)
        guard height > 0 && width > 0 else {
            return nil
        }
        let maxHeight = round(maxHeight)
        let maxWidth = round(maxWidth)
        guard height > maxHeight || width > maxWidth else {
            return nil
        }
        let heightProportions = height / maxHeight
        let widthProportions = width / …
Run Code Online (Sandbox Code Playgroud)

core-graphics uiimage cgcontext swift

5
推荐指数
1
解决办法
923
查看次数

如何在RxSwift中为反跳设置RxTimeInterval?

无法为rxswift中的去抖动设置Rxtimeinterval。我的代码如下。我收到此错误消息“无法将类型'Double'的值转换为预期的参数类型'RxTimeInterval'(aka'DispatchTimeInterval')”

searchBar
    .rx.text // Observable property thanks to RxCocoa
    .orEmpty // Make it non-optional
    .debounce(0.5, scheduler: MainScheduler.instance) // Wait 0.5 for changes.
    .distinctUntilChanged() // If they didn't occur, check if the new value is the same as old.
    .filter { !$0.isEmpty }
Run Code Online (Sandbox Code Playgroud)

错误信息:

“无法将类型为'Double'的值转换为预期的参数类型'RxTimeInterval'(aka'DispatchTimeInterval')”

xcode ios swift rx-swift

4
推荐指数
2
解决办法
1211
查看次数

AVAudioPlayer不播放mp3?

我想让我AVAudioPlayer播放一些mp3文件.它播放其中一些,但我有一个无法播放的文件!

要播放该文件,我将其在我的设备上下载到应用程序文件夹中并以这种方式初始化:

[[AVAudioPlayer alloc] initWithContentsOfURL:soundPath error:nil];
Run Code Online (Sandbox Code Playgroud)

怎么播放文件?为什么不玩?

链接到文件:abc.mp3

编辑:

(这是显示错误的代码.代码中有一个自述文件.尝试使用该设备.)

***.pch

#import <Availability.h>

#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import <SystemConfiguration/SystemConfiguration.h>
    #import <MobileCoreServices/MobileCoreServices.h>
    #import <AVFoundation/AVFoundation.h>
    #import <AudioToolbox/AudioToolbox.h>
#endif



ViewController.h

#import <UIKit/UIKit.h>
#import "AFNetworking.h"

@interface SCRViewController : UIViewController <AVAudioPlayerDelegate>
{
    UIButton *button;
    __block UIProgressView *view;
    NSOperationQueue *queue;
    __block BOOL isFile;
    UIButton *play;
    NSString *path;
    AVAudioPlayer *_player;
}

@end


ViewController.m

#import "ViewController.h"

@implementation …
Run Code Online (Sandbox Code Playgroud)

xcode mp3 avaudioplayer ios

3
推荐指数
1
解决办法
5101
查看次数

如何在 vee 验证 3.0 版本中验证十进制值

我想验证纬度和经度值,我的代码是

    <ValidationProvider :name=waypointLang.form.latitude rules="required|decimal">
        <div slot-scope="{ errors }">
            <input v-model="waypoint.latitude" readonly name="latitude" type="text" autofocus :placeholder="waypointLang.form.latitude" class="form-control" id="latitude"/>
                   <span class="required-field">{{ errors[0]}}</span>
        </div>
    </ValidationProvider>
Run Code Online (Sandbox Code Playgroud)

我收到错误不存在这样的验证器“十进制”。

提前致谢

vue.js vuejs2

3
推荐指数
1
解决办法
4555
查看次数

NSFileManager不创建文件夹

- (NSURL *) applicationDocumentsDirectory
{
    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
Run Code Online (Sandbox Code Playgroud)

....

NSURL *folder = [[[Database sharedInstance] applicationDocumentsDirectory] URLByAppendingPathComponent:@"temp"];
BOOL isFolder;
NSLog(@"URL: %@", folder);
if ([[NSFileManager defaultManager] fileExistsAtPath:folder.absoluteString isDirectory:&isFolder] == NO)
{
    NSLog(@"IsFolder: %d", isFolder);
    [[NSFileManager defaultManager] createDirectoryAtURL:folder withIntermediateDirectories:YES attributes:nil error:&error];
    if (error)
        NSLog(@"Error: %@", error.localizedDescription);
}
Run Code Online (Sandbox Code Playgroud)

我运行这部分代码两次.

我希望该文件夹将被创建,但每次我收到一个日志:"IsFolder:7".

为什么在第一次运行后没有创建文件夹?

xcode objective-c nsfilemanager ios

2
推荐指数
2
解决办法
7763
查看次数