- (IBAction)checkUpdate:(id)sender { NSString *[email protected]"http://www.dszpvip.com/index.php?ios/api"; NSURL * url=[NSURL URLWithString:urlStr]; NSURLRequest * request=[[NSURLRequest alloc]initWithURL:url]; NSError * error=nil; NSData * data=[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&error]; NSDictionary *json=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error]; NSMutableArray * images= [json objectForKey:@"data"]; // NSLog(@"images=%@",images); NSString *document=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSString *plistPath=[document stringByAppendingPathComponent:@"images.plist"]; //NSString * [email protected]"我是岁"; [images writeToFile:plistPath atomically:YES]; NSLog(@"path=%@",plistPath); }
时间: 2025-01-16 08:55:06