小编Gaj*_*han的帖子

什么是解析?

解析是我在开发过程中遇到的很多东西,但作为一个大三学生,我认为我会在某些时候得到它的需要.在我目前的项目中,我被告知要为某个函数找到并使用HTML解析器,我在网上找到了一对,但HTML解析器实际上做了什么?解析一个对象意味着什么?

c# parsing html-parsing

45
推荐指数
4
解决办法
8万
查看次数

从不兼容类型'id <UIApplicationDelegate>'分配给'AppDelegate*'

在我的项目中,它表示从不兼容的类型'id'分配给'AppDelegate*'.

究竟是什么?为什么会出现此警告?

我已经在.m宣布了

AppDelegate *appdev;
Run Code Online (Sandbox Code Playgroud)

并在viewDidLoad中

{
    appdev = [[UIApplication sharedApplication]delegate];     <= warning here
}
Run Code Online (Sandbox Code Playgroud)

我想隐藏这个警告.我该怎么办?提前致谢.

iphone objective-c ios

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

iOS7新更新V 7.1(11D167)在Xcode 5中不兼容开发

我收到了IOS7新版本V7.1的通知.我已经在我的iPhone 4S上安装了.由于我是开发人员,因此在Xcode 5 SDK中未在开发模式中检测到iPhone 4S.当我在Xcode中打开组织者时.表明,


iOS SDK的此安装不支持"iPhone 4S"上的iOS版本.请将设备恢复到下面列出的操作系统版本,或更新到最新版本的iOS SDK; 这是可用的.

安装在iPhone 4S 7.1(11D167)上的操作系统


希望Apple解决这个问题.

谢谢你的帮助.

iphone ios xcode5 ios7.1 xcode5.1

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

iPhone游戏中心提交最高分?

我正在使用以下功能向游戏中心提交分数.如何修改下面的代码,以便我只能在已经提交的分数最高的情况下发送分数?而且我不想在当地保持分数.有帮助吗?

- (void) reportScore: (int64_t) score forCategory: (NSString*) category 
{
 GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:category] autorelease]; 
 scoreReporter.value = score;
 [scoreReporter reportScoreWithCompletionHandler: ^(NSError *error) 
  {
   [self callDelegateOnMainThread: @selector(scoreReported:) withArg: NULL error: error];
  }];
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

编辑:我刚刚发现它仅由游戏中心处理...只有最高分才会显示在游戏中心应用上.

iphone objective-c game-center

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

如何为iPhone 6 Plus上的所有iPhone设备支持一个xib?

我开始了一个新的iOS应用程序.应用程序要求应用程序应支持从iPhone 4到iPhone 6 Plus.我非常熟悉使用Xib文件.到目前为止,我将我的应用程序与iPhone 5和iPhone 5以下区分开来.为此,我使用2个Xib文件,一个用于iPhone 5,另一个是iPhone 5,根据设备高度,我添加了这样.但现在苹果已经将iPhone 6和iPhone 6 Plus与iOS 8和XCode 6一起推出.对于这4种类型的设备,

1)iPhone 4 2)iPhone 5 3)iPhone 6和4)iPhone 6 Plus我需要添加4个Xib或任何其他解决方案.

要学习故事板,现在我没有那么多时间,因为我的应用程序已经从客户端确认了发布日期.但我将来肯定会了解sotryboard.

我尝试过使用Autolayout概念,但它对我不起作用.而且我对Autolayout概念也没有充分的了解.昨天我用XCode 6开始了我的新项目,所以我采用了iPhone 6视图并尝试使用自动调整和自动布局但不适用于我并且视图重叠.我知道不同的设备创建不同的xib并不是一个好习惯.使用每个xib创建每个设备将花费大量时间.从昨天开始,我真的很烦心如何处理不同的设备.请有人帮我解决这个问题.非常感谢你.如果我的内容有任何错误,请原谅我.

iphone objective-c ios xcode6

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

iOS 从另一个类更新 ViewController UILabel

我是开发新手,一直在用头撞墙试图弄清楚这一点,我确信,我错过了一些愚蠢的东西,但在尝试了各种不同的解决方案后,我仍然无法得到结果我在寻找。

我希望能够从另一个类更新 ViewController 中的 UILabel,这是一个我无法运行的小演示程序,我有一个 ViewController,它有两个 UILabel,一个是从 更新的,另一个是我更新viewDidDoad的我想从另一个名为 NewClass 的类进行更新ViewController,该类是从 调用的,我可以看到该类正在被正确调用,因为控制台正在记录条目,NSLog但我无法获取更新UILabel.

提前致谢。

视图控制器.h

 #import <UIKit/UIKit.h>

 @interface ViewController : UIViewController {

   UILabel *_labelupdate01;
   UILabel *_labelupdate02;     
 }

 @property (nonatomic, retain) IBOutlet UILabel *labelupdate01;
 @property (nonatomic, retain) IBOutlet UILabel *labelupdate02;

 @end
Run Code Online (Sandbox Code Playgroud)

视图控制器.m

#import "ViewController.h"
#import "NewClass.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize labelupdate01;
@synthesize labelupdate02;


- (void)viewDidLoad
{
    [super viewDidLoad];

    labelupdate01.text = @"Update from ViewController";

    [NewClass updatedisplay];
}
@end
Run Code Online (Sandbox Code Playgroud)

新类.h

#import <Foundation/Foundation.h>

@class ViewController; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uiviewcontroller uilabel ios

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

- [__ NSArrayM insertObject:atIndex:]:object不能为nil

我收到错误对象不能为零.我正在使用Web服务,当我使用循环解析它崩溃并发送输出-[__NSArrayM insertObject:atIndex:]:对象不能为nil作为错误,因为我在空白值上有空值NSMutableArray我正在尝试解析.

我试着修复

(1)if([Array containsObject:[NSNull null]])
(2)if([Array objectAtIndex:0
(3)if([Array objectAtIndex:counter] == 0
方法.

我的代码是,

if([[[node childAtIndex:counter] name] isEqualToString:@"Phone"]){

                if([phoneno containsObject:[NSNull null]]){
                    phone.text = @"-";
                }
                else{
                    NSString *str = [[node childAtIndex:counter] stringValue];
                    [phoneno addObject:str];
                    NSString *myString = [phoneno componentsJoinedByString:@","];
                    [phone setText:myString];
                    phone.text = [NSString stringWithFormat:@"%@",myString];
                }
            }
Run Code Online (Sandbox Code Playgroud)

在这里,phoneno是NSMutableArray

iphone xcode objective-c ios

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

如何实现TouchXml Parser?

我已经使用TouchXml解析器实现了演示.它工作正常.但我想像下面那样解析xml.

例:

<Root>
<tag1></tag1>
<tag2>
      <temp1></temp1>
      <temp2></temp2>
      <temp3></temp3>
</tag2>
<tag3></tag3>

</Root>
Run Code Online (Sandbox Code Playgroud)

如何解析这种类型的例子?

iphone

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

UIAction Sheet和警报问题

您好,我是Xcode和iOS编程新手.我在我的动作表和警报中遇到了一些麻烦,必须按两次才能工作.它还说:"提交由其超级视图剪辑的动作表".某些控件可能无法响应触摸.在iPhone上尝试 - [UIActionSheet showFromTabBar:]或 - [UIActionSheet showFromToolbar:]而不是 - [UIActionSheet showInView:].

{
    UIActionSheet   *actionSheet = [[UIActionSheet alloc]
                                  initWithTitle:@"¿?" delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Send" otherButtonTitles:nil];

    [actionSheet showInView:self.view];
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激!

iphone objective-c uialertview uiactionsheet ios

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

我们可以在多个视图上添加单个手势并使其工作吗?

我正在研究 Pan Gesture 的样本。我很想知道我可以在两个视图上添加单个手势吗?

我的代码如下:

UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(invokePanGesture:)];
[panGesture setMinimumNumberOfTouches:1];
[panGesture setMaximumNumberOfTouches:2];

[btnGreen addGestureRecognizer:panGesture];
[btnYellow addGestureRecognizer:panGesture];
Run Code Online (Sandbox Code Playgroud)

我的处理程序方法如下:

- (void)invokePanGesture:(UIPanGestureRecognizer*)recognizer {
CGPoint translation = [recognizer translationInView:self.view];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, 
                                     recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
}
Run Code Online (Sandbox Code Playgroud)

现在的问题是手势识别器在我的情况下只考虑最后一个视图btnYellow作为它的视图。如果我创建两个单独的 GestureRecognizer 对象,它就可以工作。所以请让我明白:

  1. 是否可以在多个视图中使用单个手势?

  2. 如果是,那么如何?

  3. 如果是现在,为什么?

提前致谢

iphone uigesturerecognizer ios uipangesturerecognizer

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