小编dvd*_*sgn的帖子

将Google Analytics添加到iOS App时出现问题

当我在我的应用中实施Google Analytics时,请使用此演练:http: //code.google.com/mobile/articles/analytics_end_to_end.html

添加了libGoogleAnalytics.a CFNetwork和libsqlite3.0.dylib框架后,将GANTracker.h添加到我的AppDelegate.m中

我收到此错误:

Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GANTracker", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

而应用程序甚至不会编译.我的应用程序针对iOS 5.0

我很困惑.任何建议或工作都将受到高度赞赏.

google-analytics ios ios5

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

在嵌套的NSDictionary中替换NSNull的出现次数

这个问题类似于这个问题,但这种方法只适用于字典的根目录下.

我想NSNull用空字符串替换任何出现的值,以便我可以将完整的字典保存到plist文件(如果我用NSNull添加它,文件将不会写入).

但是,我的词典里面嵌套了词典.像这样:

"dictKeyName" = {
    innerStrKeyName = "This is a string in a dictionary";
    innerNullKeyName = "<null>";
    innerDictKeyName = {
        "innerDictStrKeyName" = "This is a string in a Dictionary in another Dictionary";
        "innerDictNullKeyName" = "<null>";
    };
};
Run Code Online (Sandbox Code Playgroud)

如果我使用:

@interface NSDictionary (JRAdditions)
- (NSDictionary *) dictionaryByReplacingNullsWithStrings;
@end

@implementation NSDictionary (JRAdditions)

- (NSDictionary *) dictionaryByReplacingNullsWithStrings {

    const NSMutableDictionary *replaced = [NSMutableDictionary dictionaryWithDictionary:self];
    const id nul = [NSNull null];
    const NSString *blank = @"";

    for(NSString *key in replaced) …
Run Code Online (Sandbox Code Playgroud)

replace nsdictionary plist ios nsnull

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

Shell脚本调用错误 - Xcode 6

我最近从另一位无法完成项目的开发人员那里获得了一个项目.我唯一的问题是,我无法通过Xcode为模拟器或设备构建项目.

我得到的错误是:

Failed to write out copy of document for diagnostics: Failed to write copy of document to path "(null)": Failed to write out copy of document because it has no file URL
Showing first 200 notices only

**Command /bin/sh failed with exit code 255**
Run Code Online (Sandbox Code Playgroud)

任何人都可以建议从哪里开始寻找解决这个构建问题的bug?

额外细节: 我正在运行Xcode 6.0.1.在"构建阶段"的"运行脚本"区域中,有一个用于Crashlytics.framework的Shell(/ bin/sh)脚本,我之前没有使用过.不确定这是否有帮助.

编辑

构建阶段有两个Shell.Crashlytics和pods:

Shell: /bin/sh

"${SRCROOT}/Pods/Pods-resources.sh"
Run Code Online (Sandbox Code Playgroud)

Shell: /bin/sh

./Crashlytics.framework/run xxxxxxxxxxxxx
Run Code Online (Sandbox Code Playgroud)

shell xcode build exit-code ios

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

仍然无效的产品标识符... iOS

我一直从应用购买产品请求中获得无效的产品标识符.

我检查过以下内容:

  1. 检查配置文件,删除并重做几次...

  2. 在itunesconnect中检查产品标识符(uk.co.companyname.appname.product_name).

  3. 从手机中删除应用程序和配置并重新安装.

  4. 在手机上退出应用程序商店.

  5. 检查我的代码签名(签名为iPhone Developer(以uk.co.companyname.appname作为标识符)

  6. 确保应用程序标识符正确地位于info.plist中.

  7. 已提交和拒绝的应用二进制文件

  8. 在手机上运行,​​而不是模拟器.

这是我获取产品的代码:

- (void)loadProducts
{
    NSSet *productIdentifiers = [NSSet setWithObjects:uk.co.companyname.appname.product_name, uk.co.companyname.appname.product_name2, uk.co.companyname.appname.product_name3, nil];

    for(NSString *pk in productIdentifiers) NSLog(@"%@", pk);

    SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
    productsRequest.delegate = self;
    [productsRequest start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
    NSLog(@"products: %d", [response.products count]);
    NSLog(@"invalidProductIdentifiers: %d", [response.invalidProductIdentifiers count]);
}
Run Code Online (Sandbox Code Playgroud)

我得到:

products: 0
invalidProductIdentifiers: 9
Run Code Online (Sandbox Code Playgroud)

in-app-purchase ios

5
推荐指数
0
解决办法
536
查看次数

检查互联网连接iOS 5

我正在制作一个需要互联网连接的应用程序.我正在寻找检查互联网连接并返回警报视图的最佳方法.我已经找到了解决方法,只能找到在iOS 4中完成上述操作的方法,但我正在制作的应用程序是在iOS 5中.

我已经看过苹果Reachability示例代码了,但是当我尝试实现时,这只会让我的代码错误变得疯狂(因为它是为iOS 4构建的).

编辑:当我将reachability.h文件导入我的项目时,我得到10个错误(其中6个我可以简单地修复)和4个我不知道该怎么做.

iphone connectivity reachability ios5 automatic-ref-counting

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