小编pan*_*kaj的帖子

雷达像LOVOO应用程序与滑块

我正在开发一个具有RADAR功能的应用程序,就像LOVOO应用程序一样.我没有使用CoreLocation和其他基于位置的框架的经验.

如果您能告诉我如何实现这一目标,将不胜感激.我应该使用哪些框架以及如何最初进行.

虽然同样的问题已经在这里SO存在于我的问题是一样的雷达画面像LOVOO ,但对我没有用它这就是为什么我又要求它.

我曾尝试自己到目前为止,我已经点lat和长值绘制和我算中心点(我的位置)和其他点之间的角度和距离

- (float)angletoCoordinate:(CLLocationCoordinate2D)second {

//myCurrentLocation is origin

//second is point

float lat1 = DegreesToRadians(myCurrentLocation.coordinate.latitude);
float lon1 = DegreesToRadians(myCurrentLocation.coordinate.longitude);

float lat2 = DegreesToRadians(second.latitude);
float lon2 = DegreesToRadians(second.longitude);

float dLon = lon2 - lon1;

float y = sin(dLon) * cos(lat2);
float x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(dLon);
float radiansBearing = atan2(y, x);
if(radiansBearing < 0.0)
{
    radiansBearing += 2*M_PI;
}

return radiansBearing;
}


-(float)calculateXPointWithLoc:(ARGeoLocation *)loc andDelta:(float)delta{
float angle = radiansToDegrees(delta);
float dpx …
Run Code Online (Sandbox Code Playgroud)

iphone core-location augmented-reality ios

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

当键盘出现时,iOS 8 UIView不会向上移动

我正在开发有一个聊天应用程序UITableView和一个UIView包含UITextFieldUIButton在其中.我正在使用以下代码UIView在键盘出现时向上移动.

(void)keyboardWillShow:(NSNotification *)notification
{

    NSDictionary* info = [notification userInfo];
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

    [UIView animateWithDuration:0.2f animations:^{

        CGRect frame = self.inputView.frame;
       UIInterfaceOrientation orientation = self.interfaceOrientation;
    if (orientation == UIInterfaceOrientationLandscapeLeft || orientation ==        UIInterfaceOrientationLandscapeRight)
            frame.origin.y -= kbSize.width;
        else
            frame.origin.y -= kbSize.height;

        self.inputView.frame = frame;
       ;
    }];
}
Run Code Online (Sandbox Code Playgroud)

此代码在iOS 7之前正常工作,但在iOS 8 UIView中没有显示在键盘上方.

任何人都可以建议可能存在的问题,或者iOS 8中有什么变化吗?

keyboard uitableview uitextfield uiview ios8

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

根据键盘和预测文本视图iOS 8向上或向下移动我的工具栏

我正在开发一个聊天应用程序,它UITextView在聊天屏幕的底部有一个工具栏(带有和其他按钮),就像whatsapp一样,它根据键盘的可见性上下移动,直到iOS 7 才能正常工作.

我已经UIKeyboardDidChangeFrameNotification使用了以下代码,我用它来获取键盘框架

  CGRect kKeyBoardFrame = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
Run Code Online (Sandbox Code Playgroud)

并相应地设置工具栏的框架.

但它不适用于具有预测文本的iOS 8.任何帮助赞赏.

编辑:

UIKeyboardDidChangeFrameNotification 当预测文本视图向上或向下移动时,不会被激起.

附加快照

图像与预测文本 在此输入图像描述

iphone keyboard uiview ios8

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

Youtube视频无法在iOS 8中以横向模式播放

我的应用程序包括在横向和纵向模式下播放视频的功能.视频可以是youtube也一切正常,直到iOS 7但现在youtube视频在iOS 8上无法在横向模式下工作.

我的代码:

- (NSUInteger)application:(UIApplication *)applicationsupportedInterfaceOrientationsForWindow:(UIWindow *)window {


  if ([[window.rootViewController presentedViewController]
     isKindOfClass:[MPMoviePlayerViewController class]] || [[window.rootViewController presentedViewController] isKindOfClass:NSClassFromString(@"MPInlineVideoFullscreenViewController")])        {

      return UIInterfaceOrientationMaskAllButUpsideDown;
  } else {

      if ([[window.rootViewController presentedViewController]
         isKindOfClass:[UINavigationController class]]) {

          // look for it inside UINavigationController
          UINavigationController *nc = (UINavigationController *)[window.rootViewController presentedViewController];

          // is at the top?
          if ([nc.topViewController isKindOfClass:[MPMoviePlayerViewController class]]) {
            return UIInterfaceOrientationMaskAllButUpsideDown;

            // or it's presented from the top?
          } else if ([[nc.topViewController presentedViewController]
                    isKindOfClass:[MPMoviePlayerViewController class]]) {
              return UIInterfaceOrientationMaskAllButUpsideDown;
          }
      }
  } 

  return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)

一切都工作正常,直到iOS 7,但停止在iOS 8上工作.任何帮助赞赏

youtube iphone video ios ios8

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

将NSString重新转换为NSArray

我已经使用下面的代码将NSArray转换为NSString假设我有一个包含一些数据的数组.

NSString *sample=[array description];
NSLog(@"%@",sample);
Run Code Online (Sandbox Code Playgroud)

打印:

 (
    {
    URL = "1a516af1a1c6020260a876231955e576202bbe03.jpg##37911944cc1ea8fd132ee9421a7b3af326afcc19.jpg";
    userId = 0;
    wallpaperId = 31;
  },
    {
    URL = "a9356863fa43bc3439487198283321622f88e31f.jpg##f09c743ebdc26bb9f98655310a0529b65a472428.jpg";
    userId = 0;
    wallpaperId = 30;
    }
)
Run Code Online (Sandbox Code Playgroud)

它看起来像数组,但它实际上是一个字符串.现在我想知道,我怎样才能重新回到NSArray?帮助赞赏.

请这不是一个重复的问题,我无法在任何地方找到相同的问题.

iphone objective-c nsstring nsarray

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