我是以编程方式实现列表视图控制器.当我尝试运行该项目时,我收到错误:
2012-11-07 22:46:34.719 myTableViewControl[12021:c07] The app delegate must implement the window property if it wants to use a main storyboard file.
2012-11-07 22:46:34.722 myTableViewControl[12021:c07] -[AppDelegate setWindow:]: unrecognized selector sent to instance 0x7674e70
2012-11-07 22:46:34.723 myTableViewControl[12021:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate setWindow:]: unrecognized selector sent to instance 0x7674e70'
*** First throw call stack:
(0x1c8e012 0x10cbe7e 0x1d194bd 0x10df7ea 0x1c7dcf9 0x1c7d94e 0x1d60 0x107b7 0x10da7 0x11fab 0x23315 0x2424b 0x15cf8 0x1be9df9 0x1be9ad0 0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x117da 0x1365c 0x1bd2 …Run Code Online (Sandbox Code Playgroud) uiviewcontroller uinavigationcontroller uiwindow ios appdelegate
我正在使用Newtonsoft.Json将对象解析为json字符串.它会像这样返回一些思考:
{\"code\":-1,\"idName\":\"empty\",\"idValue\":0,\"message\":\"Failed,can not read object from body\"}
Run Code Online (Sandbox Code Playgroud)
它不是一个有效的json字符串我认为,任何人都可以帮我工作?
我想要的是这样的:
{"code":-1,"idName":"empty\",\"idValue\":0,\"message\":\"Failed,can not read object from body\"}
Run Code Online (Sandbox Code Playgroud)
public static class CommonUtility
{
// format response string
public static string FormatResponseString(int code, string idName, long idValue, string message)
{
ResponseString rs = new ResponseString();
rs.code = code;
rs.idName = idName;
rs.idValue = idValue;
rs.message = message;
string json = JsonConvert.SerializeObject(rs);
return json;
}
}
public class ResponseString
{
public int code;
public string idName;
public long idValue;
public string message;
}
Run Code Online (Sandbox Code Playgroud)
编辑:这是来自响应fidder TextView的实际json我可以看到: …
我在VS2008中有一个asp.net网站,我在本地目录中预编译,这是IIS 7的虚拟目录(http:// machinename:83)
当我1.启动http:// machinename:83 / 2. VS2008 - > debug - > Attach to Process ..-->选择w3wp.exe 3.在VS2008的代码中设置断点4.运行app
虽然我发现它无法进入断点.(我确定必须运行断点)
有谁可以帮我这个?
我有两个视图控制器,GroupListViewController和GroupDetailViewController,来回切换,当通过单击行单元格切换,运行错误,我没有xib甚至.我以编程方式完成所有组件.在这里搜索相同的问题,这不是我的类型.
在下面的代码片段中,"CustomGroupListViewCell*plcc"CustomGroupListViewCell是一个自定义的UITableViewCell,你可以实现一个带空的转储,
在这里列出代码.
GroupListViewController.h
#import <UIKit/UIKit.h>
@class GroupDetailViewController;
@interface GroupListViewController : UITableViewController
{
NSArray * contentArray;
GroupDetailViewController * dvController;
}
@property (nonatomic, retain) GroupDetailViewController * dvController;
@end
Run Code Online (Sandbox Code Playgroud)
GroupListViewController.m
#import "GroupListViewController.h"
#import "CustomGroupListViewCell.h"
#import "ZYAppDelegate.h"
#import "GroupDetailViewController.h"
@interface GroupListViewController ()
@end
@implementation GroupListViewController
@synthesize dvController;
- (void) viewDidLoad
{
contentArray = [[NSArray arrayWithObjects:@"heyun", @"wushi", @"ios", nil]retain];
[super viewDidLoad];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- …Run Code Online (Sandbox Code Playgroud)