当我在我的应用中实施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
我很困惑.任何建议或工作都将受到高度赞赏.
这个问题类似于这个问题,但这种方法只适用于字典的根目录下.
我想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) 我最近从另一位无法完成项目的开发人员那里获得了一个项目.我唯一的问题是,我无法通过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) 我一直从应用购买产品请求中获得无效的产品标识符.
我检查过以下内容:
检查配置文件,删除并重做几次...
在itunesconnect中检查产品标识符(uk.co.companyname.appname.product_name).
从手机中删除应用程序和配置并重新安装.
在手机上退出应用程序商店.
检查我的代码签名(签名为iPhone Developer(以uk.co.companyname.appname作为标识符)
确保应用程序标识符正确地位于info.plist中.
已提交和拒绝的应用二进制文件
在手机上运行,而不是模拟器.
这是我获取产品的代码:
- (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) 我正在制作一个需要互联网连接的应用程序.我正在寻找检查互联网连接并返回警报视图的最佳方法.我已经找到了解决方法,只能找到在iOS 4中完成上述操作的方法,但我正在制作的应用程序是在iOS 5中.
我已经看过苹果Reachability示例代码了,但是当我尝试实现时,这只会让我的代码错误变得疯狂(因为它是为iOS 4构建的).
编辑:当我将reachability.h文件导入我的项目时,我得到10个错误(其中6个我可以简单地修复)和4个我不知道该怎么做.
iphone connectivity reachability ios5 automatic-ref-counting
ios ×4
ios5 ×2
build ×1
connectivity ×1
exit-code ×1
iphone ×1
nsdictionary ×1
nsnull ×1
plist ×1
reachability ×1
replace ×1
shell ×1
xcode ×1