小编c r*_*ald的帖子

无法访问localhost上的API资源管理器

我正在尝试构建一个Endpoints应用程序,但我是Google App Engine的新手.

根据我的理解,SDK中包含某种API Explorer,可以让我测试/验证我的API - 文档说:"通过导航到Google API Explorer中测试API后端http://localhost:8080/_ah/api/explorer".但是我找不到任何关于API Explorer实际上是,做什么或看起来像什么的文档.

在任何情况下,当我尝试点击该网址时,我会立即重定向到https://developers.google.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/,告诉我什么都没有用,似乎它必定是某种错误.

devappserver日志说:

INFO     2013-07-17 17:27:54,574 server.py:593] default: "GET /_ah/api/explorer HTTP/1.1" 302 -
INFO     2013-07-17 17:27:56,099 server.py:593] default: "GET /_ah/api/static/proxy.html?jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.7JUwNUXMAS8.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTO0dpKS_pssf5r3z87E6FlFvDGdOg HTTP/1.1" 200 1933
INFO     2013-07-17 17:27:56,193 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,492 server.py:593] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 200 576
INFO     2013-07-17 17:27:56,507 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,583 server.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 2342
INFO     2013-07-17 17:27:56,811 server.py:593] …
Run Code Online (Sandbox Code Playgroud)

google-app-engine google-cloud-endpoints

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

使用警报按钮的标准Apple翻译?

这是真的?实例化UIAlertButton时,必须为"取消"按钮传递一个显式标题,如下所示:

UIAlertView *av = 
    [[UIAlertView alloc] 
         initWithTitle:@"Error" 
         message:err.localizedDescription 
         delegate:nil 
         cancelButtonTitle:@"Cancel" 
         otherButtonTitles:nil];
Run Code Online (Sandbox Code Playgroud)

这意味着如果你想要一个本地化的应用程序(你当然可以这样做),你也必须本地化取消字符串,即使Apple显然已经有了规范的翻译.我真的被迫写这样的东西来处理它(或者这甚至可以)?

NSBundle* uikitBundle = [NSBundle bundleForClass:[UIButton class]];
UIAlertView *av = 
    [[UIAlertView alloc] 
         initWithTitle:NSLocalizedString(@"Error", @"Title for Alert box when error occurs") 
         message:err.localizedDescription 
         delegate:nil 
         cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"Cancel", @"Localizable", uikitBundle, nil) 
         otherButtonTitles:nil];
Run Code Online (Sandbox Code Playgroud)

这对我来说太可怕了,但我必须保持自己的Apple HIG强制翻译单词(如"取消"或"确定")的想法似乎同样荒谬.

translation localization uialertview ios

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

NSInteger与iOS上的64位架构

所以,我想弄清楚我应该关心NSInteger与int有多少关系.我没有CS学位,所以很多这些类型转换参数都很难说.我可以说,最好的论点是"在iOS中使用NSInteger而不是int,这样最终如果/当64位iOS出现时,你的变量仍然是存储指针的正确大小." 很公平.除了我在我的int中存储指针大概永远不会.

假设我有一个int存储欠Jack的魔法豆的数量,另一个int存储皮肤猫的方法数量,我在函数之间传递它们并将它们写入Core Data等等,然后Apple发布64 -bit iOS - 有什么变化?我为什么在意?

另外,如果我关心,为什么不使用int32_t而不是NSInteger?好像将让事情变得可预测的方式.

ios

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

将状态注入UITabBarController子控制器

如何将状态注入到显示为UITabBarController的子视图的viewcontroller中?我有两个兄弟选项卡,它们都显示选定日期的信息.可以在TextView选项卡或GraphView选项卡中更改选择的日期,我希望两个选项卡保持同步,这样我就不会混淆用户.

一种相当简单的方法是声明一个全局状态变量来保存currentDate,并让每个tab视图控制器在-viewWillAppear中检查currentDate:.

但是所有的建议都说不要做全局变量(或等价物,比如共享单例或应用程序委托上的属性,等等).相反,您应该进行依赖注入,以便每个控制器获得对共享状态对象的引用.但是你什么时候/怎么做?在用户请求查看它们之前,UITabBarController通常不会加载其选项卡视图.我不认为我想在-application:didFinishLaunchingWithOptions:中预加载所有内容,从而减慢应用程序启动速度.但UITabBarController似乎没有提供任何类型的-tabWillAppear事件来挂钩,所以我似乎坚持将currentDate保持在全局.

我错过了什么吗?谢谢.

tabs dependency-injection uitabbarcontroller ios

6
推荐指数
0
解决办法
284
查看次数

我可以从CGContext查询当前点吗?

Apple的Quartz2d编程指南说:"Quartz跟踪当前点,这是用于路径构建的最后一个位置." 在给出CGContext引用的情况下,有什么方法可以查询当前的内容吗?

我正在编写分段绘制图表的方法,似乎CGContext已经知道当前点是什么,我不应该编写单独跟踪它所需的逻辑.在方法调用中传递CGContext和当前点坐标似乎很愚蠢.

cgcontext quartz-2d

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

iOS 自定义文档类型图标

谁能向我解释 UTExportedTypeDeclarations 下的 UTTypeSize64IconFile 和 UITypeSize320IconFile 键与 CFBundleDocumentTypes 中的 CFBundleTypeIconFiles 之间的区别?我在文档中找到了一些关于 CFBundleTypeIconFiles 的地方(例如:http : //developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html),但是我能找到的 UTTypeSize64IconFile 的唯一解释是:

与此 UTI 关联的 64 x 64 像素图标资源文件(位于应用程序包中)的名称。您应该只为您的应用导出的类型包含此键。

这对我来说并没有真正照亮事物。

icons ios

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

尝试从子托管上下文保存到父级时的EXC_BAD_ACCESS

我有一个EXC_BAD_ACCESS杀了我.我看不出它来自哪里.

ARC代码.SymptomRating是一个托管对象,当然:

__block DPLSymptomRating *rating;
self.editMOC = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];  // retained: strong

NSManagedObjectContext *moc = self.editMOC; //editSymptom.managedObjectContext;

[moc performBlockAndWait:^{
    NSError __autoreleasing *error = nil;
    moc.parentContext = DPLPersonalHxDataStore.shared.managedObjectContext;

    rating = [NSEntityDescription insertNewObjectForEntityForName:@"SymptomRating" inManagedObjectContext:moc];
    [moc assignObject:rating toPersistentStore:[NSPersistentStore MR_defaultPersistentStore]];

    rating.ratingCode = @101;
    rating.symptomCode = 1;
    rating.displayName = @"debug";
    NSAssert(rating!=nil, @"Cannot edit nil rating");
    NSAssert(rating.managedObjectContext==moc, @"");
    NSLog(@"validates for insert: %@", [rating validateForInsert:&error]?@"true":@"false");
    NSAssert(error==nil,@"");
    NSLog(@"inserted objects: %@", moc.insertedObjects);    // 1 object, from above
    NSLog(@"updated objects: %@", moc.updatedObjects);      // empty
    NSLog(@"deleted objects: %@", moc.deletedObjects);      // …
Run Code Online (Sandbox Code Playgroud)

exc-bad-access core-data automatic-ref-counting

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

如何将字符串复制到iOS中的剪贴板(粘贴板)?

如何将字符串复制到iOS中的剪贴板?我在文档中搜索"剪贴板",没有点击.

cocoa-touch copy-paste uipasteboard ios

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