小编And*_*scu的帖子

iOS:电话号码拨号不起作用

我正在构建一个应用程序,让您可以拨打荷兰的不同服务中心.问题是它们中的一些具有不同的商业格式(如0800-xxxx),并且设备无法拨打电话.代码如下所示:

if ([[UIApplication sharedApplication] canOpenURL:phoneURL]) {
    [[UIApplication sharedApplication] openURL:phoneURL];
}
Run Code Online (Sandbox Code Playgroud)

您知道如何格式化号码或拨打电话,无论格式如何?

编辑:这是phoneNumber的创建方式:

NSString *phoneNumberString = phoneNumber; // dynamically assigned
NSString *phoneURLString = [NSString stringWithFormat:@"telprompt:%@", phoneNumberString];
NSURL *phoneURL = [NSURL URLWithString:phoneURLString];
Run Code Online (Sandbox Code Playgroud)

ios

9
推荐指数
1
解决办法
5190
查看次数

Git冲突导致Storyboard问题

我尝试在我的Git存储库中合并两个分支,并且在我的Storyboard文件上发生了一些冲突.以下是冲突的行:

    <resources>
        <image name="IconAddToCart" width="30" height="34"/>
<<<<<<< HEAD
        <image name="IconAddToCart" width="30" height="34"/>
=======
        <image name="IconCartBig" width="149" height="111"/>
>>>>>>> 0133fd1364e6e590034bba1c0e32273bcf22a3d2
        <image name="IconCheckmark" width="13" height="13"/>
        <image name="LoginBackground" width="320" height="568"/>
        <image name="LoginBackground" width="320" height="568"/>
        <image name="LoginLogo" width="257" height="73"/>
        <image name="ScanButton" width="178" height="61"/>
    </resources>
    <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
    <simulatedMetricsContainer key="defaultSimulatedMetrics">
        <simulatedStatusBarMetrics key="statusBar"/>
        <simulatedOrientationMetrics key="orientation"/>
        <simulatedScreenMetrics key="destination" type="retina4"/>
    </simulatedMetricsContainer>
    <inferredMetricsTieBreakers>
        <segue reference="rCk-dF-YMq"/>
        <segue reference="SKx-bH-AaC"/>
        <segue reference="ofx-gD-lnj"/>
        <segue reference="Eo1-ee-RYE"/>
        <segue reference="mb5-Kc-qz1"/>
        <segue reference="qYH-kM-beE"/>
        <segue reference="QOW-kb-Y6W"/>
<<<<<<< HEAD
        <segue reference="vKq-do-lYa"/>
=======
        <segue …
Run Code Online (Sandbox Code Playgroud)

git merge conflict storyboard ios

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

日期格式 - 时区

我从服务器收到一个字符串,其日期如下:"2013-03-29T15:27:00Z".如何格式化并将其转换为NSDate?

objective-c nsdate nsdateformatter ios

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

OCMock传递任何CGSize

我正在使用OCMock,我正试图在我的一个测试中做到这样的事情:

[[mockScrollView expect] setContentSize:[OCMArg any]];
Run Code Online (Sandbox Code Playgroud)

问题是[OCMArg any]返回一个id类型,我想使用任何类型CGSize,因为我不知道它的确切值.我怎么能通过这个论点?

unit-testing primitive-types ocmock ios cgsize

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