0
#pragma mark -
#pragma mark Fetch loans from internet
-(void)loadData
{
self.responseData = [NSMutableData data];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:
@"http://192.168.1.104:8080/Test/ItemGroup.jsp"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
[connection release];
self.responseData = nil;
}
#pragma mark -
#pragma mark Process loan data
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
self.responseData = nil;
array=[responseString JSONValue];
NSMutableString *text=[NSMutableString stringWithString:@"Values:\n"];
for (int i=0; i <[array count]; i++) {
[text appendFormat:@"%@\n",[array objectAtIndex:i]];
// NSLog(@"Values:""%@\n",array);
}
}
圖莎爾,我知道這是你的第一個問題,不要把整個問題的稱號。只是給一個小標題,併發布你的問題的描述,只發布與問題有關的特定代碼。 – Krishnabhadra