开发者

Objective C Json not working in viewDidLoad

NSString *navTitle = self.navigationItem.title;

NSURL *address = [NSURL URLWithString:[NSString stringWithFormat:@"h开发者_开发知识库ttp://www.twostepmedia.co.uk/json.php?q=%@",navTitle]];
responseData = [[NSMutableData data] retain];   
NSURLRequest *request = [NSURLRequest requestWithURL:address];
[[NSURLConnection alloc] initWithRequest:request delegate:self];

Anyone have any idea why this wouldnt work, this is in the viewDidLoad method.

Thanks


I assume because self.navigationItem is not initialized until viewWillAppear:.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜