小编liv*_*v a的帖子

如何在iOS上的谷歌地图上进行徒手画?

在绘图应用程序中,我们可以识别用户何时开始绘制和移动手指以形成线条/形状.我想在地图上做同样的事情,我该怎么做?

xcode drawing polygon ios google-maps-sdk-ios

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

AFHTTPRequestOperationManager POST请求失败,网络连接丢失(-1005)

我的服务器端是谷歌计算引擎,DJango服务作为API

这是我在xcode IOS 6.1中运行的代码

static NSString *const BaseURLString = @"http://myUrl/";

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager POST:BaseURLString
   parameters:[self getParameters]
      success:^(AFHTTPRequestOperation *operation, id responseObject) {
          NSArray *returnedData = (NSArray *)responseObject;
          [self doSomething:returnedData];
      }
      failure:^(AFHTTPRequestOperation *operation, NSError *error) {
          UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error Retrieving Properties" message:[NSString stringWithFormat:@"%@", error] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
          [av show];
      }];
Run Code Online (Sandbox Code Playgroud)

它始终失败,Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."但当我从终端使用curl -datacurl --data "param1=1&param2=3" http://myUrl/它调用服务时,它工作得很完美

django objective-c http-post ios

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

iPhone如何忽略尊重语言方向

我用一个UIViewController创建了一个iPhone应用程序,并在故事板中设计了它.我已经放置了3个UIImage,每个都显示一个图像

在此输入图像描述

  • 我的手机系统语言界面设置为英文(settings-> general-> international-> language)

将我的系统语言界面更改为希伯来语,运行应用程序和图像以镜像模式(反向顺序)显示

在此输入图像描述

在尺寸检查员中,我删除了Respect language direction所有的复选标记,Horizontal, Trailing & Leading constraints但没有帮助.

还有哪些方法可以禁用/或忽略语言界面自动更正?

settings objective-c autocorrect right-to-left

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

目标c中的(覆盖)是什么

我下面就如何在iPhone创建一个酥料饼的教程在这里

(overrides)这段代码是什么:

@interface UIPopoverController (overrides)
  + (BOOL)_popoversDisabled;
@end

@implementation UIPopoverController (overrides)

  + (BOOL)_popoversDisabled 
  { 
     return NO;
  }

@end
Run Code Online (Sandbox Code Playgroud)

overriding objective-c

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

重命名已连接的操作

如何重命名已连接的操作并保持连接状态?
这些是我尝试过但失败的步骤:

  1. 在我UIViewController放置一个按钮
  2. 我通过按下控件+单击按钮拖动到代码中的空行来创建动作
  3. UIViewController .m文件 - >重命名动作 - >连接丢失(功能旁边的空心圆)
  4. 按控制键+单击按钮拖动到功能名称/正文 - >无法连接
  5. 右键单击按钮并按X - >重复步骤4 - >无法连接,删除旧连接
  6. 右键单击正确设置事件中的按钮,当鼠标转到"+"时,将鼠标放在空心圆上,重复步骤4 - >失败

奇怪的是,当拖动到不同的连接动作名称/正文时,它确实允许连接.
除了在文本编辑器中打开storyboard文件并更改函数名称之外,我可以从中做些IDE什么?

谢谢.

xcode rename objective-c interface-builder ibaction

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

如何制作UIViewController工具栏?

在故事板上放置UIViewController时,它有一个"内置"工具栏,我可以在设计过程中添加按钮.我的问题是它不会出现在运行时.有属性,toolbarHidden但这不能控制工具栏的可见性.如何将其设置为可见?

interface-builder uitoolbar uiviewcontroller

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

postgresql:\ copy方法输入有效条目并丢弃异常

输入以下命令时:

\copy mmcompany from '<path>/mmcompany.txt' delimiter ',' csv;
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

ERROR: duplicate key value violates unique constraint "mmcompany_phonenumber_key"
Run Code Online (Sandbox Code Playgroud)

我理解为什么会这样,但是如何以插入有效条目的方式执行命令,并且会丢弃创建错误的命令?

sql postgresql commit

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

将文件从GCE导出到我的本地计算机

是否有一个反向命令gcutil push基本上我想要做的是在我的本地机器上有我的python文件的副本所以我正在寻找一种方法将文件导入我的本地机器从我的谷歌计算引擎实例导出它们而不使用GIT或任何其他源控制工具

google-compute-engine gcutil

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

if([application respondsToSelector:@selector(registerUserNotificationSettings :)]) - 引发构建错误

Xcode:版本6.0(6A313)

推送通知部分取自解析

if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeAlert|UIUserNotificationTypeSound categories:nil];
        [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
        [[UIApplication sharedApplication] registerForRemoteNotifications];
    } else {
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
         UIRemoteNotificationTypeBadge |
         UIRemoteNotificationTypeAlert |
         UIRemoteNotificationTypeSound];
Run Code Online (Sandbox Code Playgroud)

引发以下错误:

 Unknown receiver 'application'; did you mean 'UIApplication'?
Run Code Online (Sandbox Code Playgroud)

apple-push-notifications xcode6

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

在不打开相机应用程序的情况下,在我自己的uiview中打开相机

我的Iphone应用程序使用相机,我有以下代码:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;

[self presentViewController:picker animated:YES completion:NULL];
Run Code Online (Sandbox Code Playgroud)

我希望相机应用程序不会打开,相反我会在我自己的uiview中使用相机,或者uiimageview可以吗?

我尝试过这行代码而不是 [self presentViewController:picker animated:YES completion:NULL];:

[self.view addSubview:picker];
Run Code Online (Sandbox Code Playgroud)

这会导致异常 [UIImagePickerController superview]: unrecognized selector sent to instance

解决方案: 我找到了这个很棒的教程,包括代码示例和下载项目

iphone camera objective-c uiimagepickercontroller

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