{"id":29,"date":"2012-07-26T12:47:26","date_gmt":"2012-07-26T04:47:26","guid":{"rendered":"http:\/\/sunyuping.cn\/?p=29"},"modified":"2012-07-26T12:47:26","modified_gmt":"2012-07-26T04:47:26","slug":"iphone%e5%bc%80%e5%8f%91%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.sunyuping.com\/index.php\/2012\/07\/26\/iphone%e5%bc%80%e5%8f%91%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81\/","title":{"rendered":"iphone\u5f00\u53d1\u5e38\u7528\u4ee3\u7801"},"content":{"rendered":"<p>\t\t\t\t&#8211; (NSString *)URLEncodedString:(NSString *)string{<br \/>\nNSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,<br \/>\n(CFStringRef)string,NULL,CFSTR(&#8220;!*'();:@&amp;=+$,\/?%#[]&#8221;),kCFStringEncodingUTF8);<br \/>\n[result autorelease];<br \/>\nreturn result;<br \/>\n}<\/p>\n<p>\/\/\u751f\u6210nonce<br \/>\n&#8211; (NSString *)generateNonce{<br \/>\nCFUUIDRef theUUID = CFUUIDCreate(NULL);<br \/>\nCFStringRef string = CFUUIDCreateString(NULL, theUUID);<br \/>\nNSMakeCollectable(theUUID);<br \/>\nreturn [(NSString *)string stringByReplacingOccurrencesOfString:@&#8221;-&#8221; withString:@&#8221;&#8221;];<br \/>\n\/\/return (NSString *)string;<br \/>\n}<\/p>\n<p>\/\/\u751f\u6210Timestamp<br \/>\n&#8211; (NSString *)generateTimestamp{<br \/>\nreturn [[NSString stringWithFormat:@&#8221;%d&#8221;, time(NULL)] retain];<br \/>\n}<\/p>\n<p><span style=\"color: #00ccff; font-size: medium;\">iPhone\u952e\u76d8\u6539\u53d8\u989c\u8272<\/span><br \/>\n\u53ea\u6709\u8fd92\u79cd\u6570\u5b57\u952e\u76d8\u624d\u6709\u6548\u679c\uff1aUIKeyboardTypeNumberPad\uff0cUIKeyboardTypePhonePad<br \/>\nkeyboardAppearance \uff1d UIKeyboardAppearanceAlert<br \/>\n\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u00a0\u00a0\u00a0NSArray *ws = [[UIApplication sharedApplication] windows];<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0for(UIView *w in ws){<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NSArray *vs = [w subviews];<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for(UIView *v in vs){<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if([[NSString stringWithUTF8String:object_getClassName(v)] isEqualToString:@&#8221;UIKeyboard&#8221;]){<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0v.backgroundColor = [UIColor redColor];<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/li>\n<li>\u00a0\u00a0\u00a0\u00a0}<\/li>\n<\/ol>\n<h1><span style=\"font-size: medium;\">\u4ece\u4e00\u4e2a\u754c\u9762push\u5230\u4e0b\u4e00\u754c\u9762\u5de6\u4e0a\u89d2\u8fd4\u56de\u6309\u94ae\u6587\u5b57\u8bbe\u7f6e<\/span><\/h1>\n<p>\u5728\u7236viewController\u4e2d\u5982\u4e0b\u8bbe\u7f6e\uff1a<br \/>\nUIBarButtonItem *backbutton = [[UIBarButtonItem alloc]init];<br \/>\nbackbutton.title = @&#8221;\u8fd4\u56de\u5217\u8868&#8221;;<br \/>\nself.navigationItem.backBarButtonItem = backbutton;<br \/>\n[backbutton release];<\/p>\n<p><span style=\"font-size: medium;\">navigationbar\u7684back\u952e\u89e6\u53d1\u5176\u4ed6\u4e8b\u4ef6<\/span><br \/>\nUIButton *back =[[UIButton alloc] initWithFrame:CGRectMake(200, 25, 63, 30)];<br \/>\n[back addTarget:self act<wbr>ion:@selector(reloadRowData:) forControlEvents:UIControlEventTouchUpInside];<br \/>\n[back setImage:[UIImage imageNamed:@&#8221;\u8fd4\u56de\u6309\u94ae.png&#8221;] forState:UIControlStateNormal];<br \/>\nUIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithCustomView:back];<br \/>\nself.navigationItem.leftBarButtonItem = loginButtonItem<br \/>\n[back release];<br \/>\n[backButtonItem release];<br \/>\n<span style=\"font-size: medium;\">\u9632\u6b62\u5c4f\u5e55\u6697\u6389\u9501\u5c4f<\/span><\/wbr><\/p>\n<p>[[UIApplication\u00a0sharedApplication]\u00a0setIdleTimerDisabled:YES];<br \/>\n<span><br \/>\n\u5c06\u56fe\u7247\u4ece\u5de6\u5230\u53f3\u7ffb\u9875\u6548\u679c\u663e\u793a<\/span><\/p>\n<p>UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 470)];<br \/>\n[imageView setImage:[UIImage imageNamed:@&#8221;Bg.jpg&#8221;]];<br \/>\nself.myImageView =imageView;<br \/>\n[self.view addSubview:imageView];<br \/>\n[imageView release];<br \/>\nCGContextRef context = UIGraphicsGetCurrentContext();<br \/>\n[UIView beginAnimations:nil context:context];<br \/>\n[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];<br \/>\n[UIView setAnimationDuration:0.5];<br \/>\n[myImageView setFrame:CGRectMake(0, 0, 310, 470)];<br \/>\n[UIView commitAnimations];<\/p>\n<p>\u8ba9\u8986\u76d6\u5728\u4e0b\u9762\u5c42\u7684\u89c6\u56fe\u63a5\u53d7\u89e6\u6478\u4e8b\u4ef6<\/p>\n<p><span>searchImage.exclusiveTouch = YES;\/\/\u7b2c\u4e00\u5c42<br \/>\nsearchImage.userInteractionEnabled = NO;<br \/>\nmyMapView.exclusiveTouch = NO;\/\/\u7b2c\u4e8c\u5c42<br \/>\nmyMapView.userInteractionEnabled = YES;<\/span><\/p>\n<p>View\u7684\u7f29\u653e<\/p>\n<p>NSValue *touchPointValue = [[NSValue valueWithCGPoint:CGPointMake(100,100)] retain];<br \/>\n[UIView beginAnimations:nil context:touchPointValue];<br \/>\ntransform = CGAffineTransformMakeScale(0.1,0.21);<br \/>\nfirstPieceView.transform = transform;<br \/>\n[UIView commitAnimations];<br \/>\n<span style=\"font-size: medium;\"><br \/>\n\u4ee3\u7801\u5faa\u73af\u6dfb\u52a0\u6309\u94ae\uff0c\u5176\u4ed6\u7a7a\u95f4\u4e5f\u53ef\u4ee5\u7528\u7c7b\u4f3c\u65b9\u6cd5\u6dfb\u52a0<\/span><\/p>\n<p>&#8211; (void)viewDidLoad {<br \/>\n[super viewDidLoad];<br \/>\nfor(int i = 0; i &lt; 5; i++){<br \/>\nCGRect frame;<br \/>\nBtn[i] = [[UIButton buttonWithType:UIButtonTypeCustom] retain];<br \/>\n[Btn[i] setImage:[UIImage imageNamed:@&#8221;Button.png&#8221;] forState:UIControlStateNormal];\/\/\u8bbe\u7f6e\u6309\u94ae\u56fe\u7247<br \/>\nframe.size.width = 55;\/\/\u8bbe\u7f6e\u6309\u94ae\u5750\u6807\u53ca\u5927\u5c0f<br \/>\nframe.size.height = 84;<br \/>\nframe.origin.x = (i%5)*57+5;<br \/>\nframe.origin.y = 10;<br \/>\n[Btn[i] setFrame:frame];<br \/>\n[Btn[i] setBackgroundColor:[UIColor clearColor]];<br \/>\n[Btn[i] addTarget:self action:@selector(btnPressed:) forControlEvents:UIControlEventTouchUpInside];<br \/>\n[self.view addSubview:Btn[i]];<br \/>\n[Btn[i] release];<br \/>\n}<br \/>\n}<br \/>\n\/\/\u54cd\u5e94\u6309\u94ae\u4e8b\u4ef6<br \/>\n-(void)btnPressed:(id)sender{<br \/>\nfor(int i = 0; i &lt; 5;i++){<br \/>\nif([sender isEqual:Btn[i]]){<br \/>\nNSLog(@&#8221;Btn[%d]:&#8221;,i);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p><span style=\"font-size: large;\">\u53bb\u9664nsstring\u4e2d\u7684\u7a7a\u683c\uff0ctable \u4ee5\u53canewline\uff0cnextline<\/span><\/p>\n<p>NSCharacterSet *whitespace = [NSCharacterSet\u00a0<span><strong>whitespaceAndNewlineCharacterSet<\/strong><\/span>];<br \/>\nNSString *<span><strong>username<\/strong><\/span>\u00a0= [mUsernameField stringValue];<br \/>\nusername = [username\u00a0<strong>stringByTrimmingCharactersInSet<\/strong>:whitespace];<br \/>\n<span style=\"font-size: large;\"><strong><br \/>\nUIImagePickerController<\/strong><\/span><br \/>\n<span style=\"font-size: medium;\"><br \/>\n\u7528<\/span><span style=\"font-size: medium;\"><strong>UIImagePickerController<\/strong><\/span>\u9009\u62e9\u3001\u663e\u793a\u56fe\u7247\u6216\u89c6\u9891\uff0c\u4e3b\u8981\u6ce8\u610f<span style=\"font-size: medium;\"><strong>UIImagePickerController<\/strong><\/span>\u51e0\u4e2a\u5c5e\u6027\u7684\u8bbe\u7f6e<br \/>\n\u4e00\uff1aUI \u663e\u793a\u6837\u5f0f\uff0c\u663e\u793a\u7684\u683c\u5f0f\u786e\u5b9a<br \/>\n1\uff1a<strong><span style=\"font-size: large;\">sourceType<\/span><\/strong><br \/>\n@property(nonatomic) UIImagePickerControllerSourceType sourceType<br \/>\nenum {<br \/>\nUIImagePickerControllerSourceTypePhotoLibrary,<br \/>\nUIImagePickerControllerSourceTypeCamera,<br \/>\nUIImagePickerControllerSourceTypeSavedPhotosAlbum<br \/>\n};<br \/>\ntypedef NSUInteger UIImagePickerControllerSourceType;<br \/>\n<strong><span style=\"font-size: large;\">sourceType\u7528\u6765<\/span><\/strong>\u786e\u5b9a\u7528\u6237\u754c\u9762\u663e\u793a\u7684\u6837\u5f0f\uff1a<br \/>\n\u5171\u4e09\u79cd\u683c\u5f0f\uff08\u6a21\u62df\u5668\u4e0a\u7684\u6548\u679c\u56fe\uff09<br \/>\nUIImagePickerControllerSourceTypePhotoLibrary,<br \/>\nUIImagePickerControllerSourceTypeCamera,<br \/>\n<a href=\"http:\/\/hiphotos.baidu.com\/hh20040410\/pic\/item\/5df06d5c2e21496efaf2c045.jpg\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/img.blog.163.com\/photo\/_9IlT-BYrXJwC0VZRpCJMQ==\/4510636501789171949.jpg\" alt=\"iphone\u5f00\u53d1\u5e38\u7528\u4ee3\u7801(\u4e0d\u65ad\u66f4\u65b0) - \u52c7\u8005\u4e4b\u5c0a - \u7b49\u5f85\" width=\"171\" height=\"215\" border=\"0\" \/><\/a><\/p>\n<p>UIImagePickerControllerSourceTypeSavedPhotosAlbum<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/img.blog.163.com\/photo\/nZof5OLWemiB-_-qIx7dhQ==\/4510636501789171950.jpg\" alt=\"iphone\u5f00\u53d1\u5e38\u7528\u4ee3\u7801(\u4e0d\u65ad\u66f4\u65b0) - \u52c7\u8005\u4e4b\u5c0a - \u7b49\u5f85\" width=\"154\" height=\"181\" border=\"0\" \/><br \/>\n\u4e3a\u4e86\u533a\u5206\u662f\u5426\u652f\u6301\u89c6\u9891\u683c\u5f0f\uff0c\u4e00\u822c\u8981\u7528\u5230\u4e0b\u9762\u8fd9\u4e2a\u51fd\u6570\uff0c\u4ee5\u4fbf\u786e\u5b9amediaTypes\u3002<br \/>\n+ (BOOL)isSourceTypeAvailable:(UIImagePickerControllerSourceType)sourceType<br \/>\n2:\u00a0\u00a0\u00a0<span style=\"font-size: large;\"><strong>mediaTypes<\/strong><\/span><br \/>\n@property(nonatomic,copy) NSArray *mediaTypes<br \/>\nmediaTypes\u7528\u6765\u786e\u5b9a\u518dpicker\u91cc\u663e\u793a\u90a3\u4e9b\u7c7b\u578b\u7684\u591a\u5a92\u4f53\u6587\u4ef6\uff0c\u56fe\u7247\uff1f\u89c6\u9891\uff1f<br \/>\n+ (NSArray *)availableMediaTypesForSourceType:(UIImagePickerControllerSourceType)sourceType<br \/>\n\u4e8c\uff1a\u9009\u53d6\u52a8\u4f5c\u5904\u7406<br \/>\n<span style=\"font-size: large;\"><strong>UIImagePickerControllerDelegate\u00a0<\/strong><\/span><br \/>\n\u901a\u8fc7\u4ee3\u7406\u6765\u5b8c\u6210\u7528\u6237\u5728\u9009\u4e2d\u56fe\u7247\uff0c\u6216\u8005choose\u89c6\u9891\u65f6\u7684\u5904\u7406\u65b9\u5f0f\uff1a<\/p>\n<p>\u5171\u6709\u4e09\u4e2a\u53ef\u9009\u7684\u4ee3\u7406\u65b9\u6cd5<br \/>\n\u2013 imagePickerController:didFinishPickingMediaWithInfo:<br \/>\n\u2013 imagePickerControllerDidCancel:<br \/>\n\u2013 imagePickerController:didFinishPickingImage:editingInfo:\u00a0\u00a0\u00a0<span>Deprecated in iPhone OS 3.0<\/span><\/p>\n<p><span>&#8211; (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info<\/span><br \/>\ninfo\u4e2d\u5305\u62ec\u9009\u53d6\u7684\u7167\u7247\uff0c\u89c6\u9891\u7684\u4e3b\u8981\u4fe1\u606f<br \/>\nNSString *const UIImagePickerControllerMediaType;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u9009\u53d6\u7684\u7c7b\u578b public.image\u00a0 public.movie<br \/>\nNSString *const UIImagePickerControllerOriginalImage;\u00a0\u00a0\u00a0 \u4fee\u6539\u524d\u7684UIImage object.<br \/>\nNSString *const UIImagePickerControllerEditedImage;\u00a0\u00a0\u00a0\u00a0\u00a0 \u4fee\u6539\u540e\u7684UIImage object.<br \/>\nNSString *const UIImagePickerControllerCropRect; \u539f\u59cb\u56fe\u7247\u7684\u5c3a\u5bf8NSValue object containing a CGRect data type<br \/>\nNSString *const UIImagePickerControllerMediaURL;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u89c6\u9891\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d \u7684 NSURL\u5730\u5740<br \/>\n\u4fdd\u5b58\u89c6\u9891\u4e3b\u8981\u65f6\u901a\u8fc7\u83b7\u53d6\u5176NSURL \u7136\u540e\u8f6c\u6362\u6210NSData<br \/>\n\u5b9e\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<br \/>\n<span style=\"font-size: small;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-size: small;\">&#8211; (void) pickImage: (id) sender<\/span><\/p>\n<p><span style=\"font-size: small;\">{<\/span><\/p>\n<p><span style=\"font-size: small;\"> UIImagePickerController *ipc = [[UIImagePickerController alloc] init];<\/span><\/p>\n<p><span style=\"font-size: small;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]){<br \/>\n<\/span><\/p>\n<p><span style=\"font-size: small;\">\u00a0\u00a0\u00a0\u00a0 ipc.sourceType =\u00a0 UIImagePickerControllerSourceTypePhotoLibrary;<\/span><\/p>\n<p><span style=\"font-size: small;\">\u00a0\u00a0\u00a0\u00a0\u00a0 ipc.mediaTypes =[UIImagePickerController availableMediaTypesForSourceType:ipc.sourceType];<br \/>\n<\/span><\/p>\n<p><span style=\"font-size: small;\">\u00a0 \u00a0 \u00a0 \u00a0 }\u00a0<\/span><\/p>\n<p><span style=\"font-size: small;\"> ipc.delegate = self;<\/span><\/p>\n<p><span style=\"font-size: small;\"> ipc.allowsImageEditing = NO;<\/span><\/p>\n<p><span style=\"font-size: small;\"> [self presentModalViewController:ipc animated:YES]; <\/span><\/p>\n<p><span style=\"font-size: small;\">}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: small;\">&#8211; (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{<\/span><\/p>\n<p><span style=\"font-size: small;\"> NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];<\/span><\/p>\n<p><span style=\"font-size: small;\"> if ([mediaType isEqualToString:@&#8221;public.image&#8221;]){<\/span><\/p>\n<p><span style=\"font-size: small;\"> \/\/ UIImage *selectedImage = [info objectForKey:UIImagePickerControllerOriginalImage];<\/span><\/p>\n<p><span style=\"font-size: small;\"> UIImage *image = [info objectForKey:@&#8221;UIImagePickerControllerOriginalImage&#8221;];<\/span><\/p>\n<p><span style=\"font-size: small;\"> \u00a0 \u00a0 NSLog(@&#8221;found an image&#8221;);<\/span><\/p>\n<p><span style=\"font-size: small;\"> [UIImageJPEGRepresentation(image, 1.0f) writeToFile:[self findUniqueSavePath] atomically:YES];<\/span><\/p>\n<p><span style=\"font-size: small;\"> \u00a0 \u00a0 SETIMAGE(image);<\/span><\/p>\n<p><span style=\"font-size: small;\"> CFShow([[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingString:@&#8221;\/Documents&#8221;]]);<\/span><\/p>\n<p><span style=\"font-size: small;\"> }<\/span><\/p>\n<p><span style=\"font-size: small;\"> else if ([mediaType isEqualToString:@&#8221;public.movie&#8221;]){<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: small;\"> NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];<\/span><\/p>\n<p><span style=\"font-size: small;\"> NSLog(@&#8221;found a video&#8221;);<\/span><\/p>\n<p><span style=\"font-size: small;\">\u00a0 \u00a0 \u00a0 \u00a0 NSData *webData = [NSData dataWithContentsOfURL:videoURL];<\/span><\/p>\n<p><span style=\"font-size: small;\"> \/\/NSData *video = [[NSString alloc] initWithContentsOfURL:videoURL];<\/span><\/p>\n<p><span style=\"font-size: small;\"> [webData writeToFile:[self findUniqueMoviePath] atomically:YES];<\/span><\/p>\n<p><span style=\"font-size: small;\"> CFShow([[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingString:@&#8221;\/Documents&#8221;]]);<\/span><\/p>\n<p><span style=\"font-size: small;\"> \/\/ NSLog(videoURL);<\/span><\/p>\n<p><span style=\"font-size: small;\"> }<\/span><\/p>\n<p><span style=\"font-size: small;\"> [picker dismissModalViewControllerAnimated:YES];<\/span><\/p>\n<p><span style=\"font-size: small;\">}<\/span><\/p>\n<p><span style=\"font-size: medium;\"><strong><br \/>\nUITextInputTraits\u5c5e\u6027<\/strong><\/span><\/p>\n<p><span><strong>autocapitalizationType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8bbe\u7f6e\u952e\u76d8\u81ea\u52a8\u5927\u5c0f\u5199\u7684\u5c5e\u6027\u00a0\u00a0\u00a0\u00a0 UITextAutocapitalizationTypeNone<br \/>\nautocorrectionType\u00a0 property\u00a0 \u8bbe\u7f6e\u662f\u5426\u6709\u81ea\u52a8\u4fee\u6539\u63d0\u793a\u00a0\u00a0 UITextAutocorrectionTypeNo<br \/>\nenablesReturnKeyAutomatically\u00a0\u00a0 Boolean\u503c\uff0d\u8bbe\u7f6e\u5728\u7528\u6237\u6ca1\u6709\u8f93\u5165\u662freturnKey\u7981\u7528\uff0c\u9ed8\u8ba4\u503cNO<br \/>\nkeyboardAppearance\u00a0 \u8bbe\u7f6e\u952e\u76d8\u663e\u793a\u65b9\u5f0f\u00a0 \u9664\u4e86\u9ed8\u8ba4\u6a21\u5f0f\u00a0 \u8fd8\u6709\u4e00\u4e2aUIKeyboardAppearanceAlert\u6a21\u5f0f<br \/>\nkeyboardType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8bbe\u7f6e\u952e\u76d8\u7c7b\u578b\u00a0\u00a0 UIKeyboardTypePhonePad \u7b49<br \/>\nreturnKeyType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8bbe\u7f6erenturnKey\u6309\u952e\u4e0a\u7684\u63d0\u793a\u6587\u5b57\u00a0\u00a0\u00a0\u00a0 UIReturnKeyGo\u00a0\u00a0 UIReturnKeyNext<br \/>\nsecureTextEntry\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/strong><\/span>BOOL\u503c\u00a0 \uff0d\uff0d \u8bbe\u7f6e\u662f\u5426\u662f\u5bc6\u7801\u4fdd\u62a4\u6a21\u5f0f\u8f93\u5165<\/p>\n<p>\u5982\u4e0b\uff1a<br \/>\n\u8bbe\u7f6e\u767b\u5f55\u7528\u7684 \u8f93\u5165\u6846 UITextField<br \/>\n\u7528\u6237\u540d\u8f93\u5165\u6846\uff1a<br \/>\nm_TF_username = [[UITextField alloc] initWithFrame:my_frame];<br \/>\nm_TF_username.borderStyle = UITextBorderStyleNone;<br \/>\nm_TF_username.clearButtonMode = UITextFieldViewModeWhileEditing;<br \/>\nm_TF_username.delegate = self;<br \/>\nm_TF_username.<span>returnKeyType<\/span>\u00a0= UIReturnKeyNext;<br \/>\nm_TF_username.<span>autocapitalizationType<\/span>\u00a0= UITextAutocapitalizationTypeNone;<br \/>\n[m_TF_username becomeFirstResponder];<br \/>\n\u5bc6\u7801\u8f93\u5165\u6846\uff1a<br \/>\nm_TF_password = [[UITextField alloc] initWithFrame:my_frame];<br \/>\nm_TF_password.borderStyle = UITextBorderStyleNone;<br \/>\nm_TF_password.clearButtonMode = UITextFieldViewModeWhileEditing;<br \/>\nm_TF_password.delegate = self;<br \/>\nm_TF_password.<span>returnKeyType<\/span>\u00a0= UIReturnKeyGo;<br \/>\nm_TF_password.<span>secureTextEntry<\/span>\u00a0=YES;<\/p>\n<p>\u952e\u76d8\u900f\u660e<br \/>\ntextField.keyboardAppearance = UIKeyboardAppearanceAlert;<\/p>\n<p>\u72b6\u6001\u680f\u7684\u7f51\u7edc\u6d3b\u52a8\u98ce\u706b\u8f6e\u662f\u5426\u65cb\u8f6c<br \/>\n[UIApplication sharedApplication].networkActivityIndicatorVisible\uff0c\u9ed8\u8ba4\u503c\u662fNO\u3002<\/p>\n<p>\u622a\u53d6\u5c4f\u5e55\u56fe\u7247<br \/>\n\/\/\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8e\u4f4d\u56fe\u7684\u56fe\u5f62\u4e0a\u4e0b\u6587\u5e76\u6307\u5b9a\u5927\u5c0f\u4e3aCGSizeMake(200,400)<br \/>\nUIGraphicsBeginImageContext(CGSizeMake(200,400));<\/p>\n<p>\/\/renderInContext \u5448\u73b0\u63a5\u53d7\u8005\u53ca\u5176\u5b50\u8303\u56f4\u5230\u6307\u5b9a\u7684\u4e0a\u4e0b\u6587<br \/>\n[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];<\/p>\n<p>\/\/\u8fd4\u56de\u4e00\u4e2a\u57fa\u4e8e\u5f53\u524d\u56fe\u5f62\u4e0a\u4e0b\u6587\u7684\u56fe\u7247<br \/>\nUIImage *aImage = UIGraphicsGetImageFromCurrentImageContext();<\/p>\n<p>\/\/\u79fb\u9664\u6808\u9876\u7684\u57fa\u4e8e\u5f53\u524d\u4f4d\u56fe\u7684\u56fe\u5f62\u4e0a\u4e0b\u6587<br \/>\nUIGraphicsEndImageContext();<\/p>\n<p>\/\/\u4ee5png\u683c\u5f0f\u8fd4\u56de\u6307\u5b9a\u56fe\u7247\u7684\u6570\u636e<br \/>\nimageData = UIImagePNGRepresentation(aImage);<\/p>\n<p>\u66f4\u6539cell\u9009\u4e2d\u7684\u80cc\u666f<br \/>\nUIView *myview = [[UIView alloc] init];<br \/>\nmyview.frame = CGRectMake(0, 0, 320, 47);<br \/>\nmyview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@&#8221;0006.png&#8221;]];<br \/>\ncell.selectedBackgroundView = myview;<\/p>\n<p>\u5728\u6570\u5b57\u952e\u76d8\u4e0a\u6dfb\u52a0button\uff1a<br \/>\n\/\/\u5b9a\u4e49\u4e00\u4e2a\u6d88\u606f\u4e2d\u5fc3<br \/>\n[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; \/\/addObserver:\u6ce8\u518c\u4e00\u4e2a\u89c2\u5bdf\u5458 name:\u6d88\u606f\u540d\u79f0<br \/>\n&#8211; (void)keyboardWillShow:(NSNotification *)note {<br \/>\n\/\/ create custom button<br \/>\nUIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];<br \/>\ndoneButton.frame = CGRectMake(0, 163, 106, 53);<br \/>\n[doneButton setImage:[UIImage imageNamed:@&#8221;5.png&#8221;] forState:UIControlStateNormal];<br \/>\n[doneButton addTarget:self action:@selector(addRadixPoint) forControlEvents:UIControlEventTouchUpInside];<\/p>\n<p>\/\/ locate keyboard view<br \/>\nUIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];\/\/\u8fd4\u56de\u5e94\u7528\u7a0b\u5e8fwindow<br \/>\nUIView* keyboard;<br \/>\nfor(int i=0; i&lt;[tempWindow.subviews count]; i++) \/\/\u904d\u5386window\u4e0a\u7684\u6240\u6709subview<br \/>\n{<br \/>\nkeyboard = [tempWindow.subviews objectAtIndex:i];<br \/>\n\/\/ keyboard view found; add the custom button to it<br \/>\nif([[keyboard description] hasPrefix:@&#8221;&lt;UIKeyboard&#8221;] == YES)<br \/>\n[keyboard addSubview:doneButton];<br \/>\n}<br \/>\n}<\/p>\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u4f7f\u7528\uff1a<br \/>\n\u88ab\u7528\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5b57\u4e32\u5fc5\u987b\u662f\u53ef\u53d8\u957f\u7684\uff0c\u4e0d\u7136\u4f1a\u51fa\u95ee\u9898<\/p>\n<p>\u5c06\u4e00\u4e2a\u7a7a\u95f4\u653e\u5728\u89c6\u56fe\u4e4b\u4e0a<br \/>\n[scrollView insertSubview:searchButton aboveSubview:scrollView];<\/p>\n<p>\u4ece\u672c\u5730\u52a0\u8f7d\u56fe\u7247<br \/>\nNSString *boundle = [[NSBundle mainBundle] resourcePath];<br \/>\n[web1 loadHTMLString:[NSString stringWithFormat:@&#8221;&lt;img src=&#8217;http:\/\/fei263.blog.163.com\/blog\/0001.png&#8217;\/&gt;&#8221;] baseURL:[NSURL fileURLWithPath:boundle]];<\/p>\n<p>\u4ece\u7f51\u9875\u52a0\u8f7d\u56fe\u7247\u5e76\u8ba9\u56fe\u7247\u5728\u89c4\u5b9a\u957f\u5bbd\u4e2d\u7f29\u5c0f<br \/>\n[cell.img loadHTMLString:[NSString stringWithFormat:@&#8221;&lt;html&gt;&lt;body&gt;&lt;img src=&#8217;http:\/\/fei263.blog.163.com\/blog\/%@&#8217; height=&#8217;90px&#8217; width=&#8217;90px&#8217;&gt;&lt;\/body&gt;&lt;\/html&gt;&#8221;,goodsInfo.GoodsImg] baseURL:nil];<br \/>\n\u5c06\u7f51\u9875\u52a0\u8f7d\u5230webview\u4e0a\u901a\u8fc7javascript\u83b7\u53d6\u91cc\u9762\u7684\u6570\u636e\uff0c\u5982\u679c\u53ea\u662f\u53d1\u9001\u4e86\u4e00\u4e2a\u8fde\u63a5\u8bf7\u6c42\u83b7\u53d6\u5230\u6e90\u7801\u4ee5\u540e\u53ef\u4ee5\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u83b7\u53d6\u6570\u636e<br \/>\nNSString *javaScript1 = @&#8221;document.getElementsByName(&#8216;.u&#8217;).item(0).value&#8221;;<br \/>\nNSString *javaScript2 = @&#8221;document.getElementsByName(&#8216;.challenge&#8217;).item(0).value&#8221;;<br \/>\nNSString *strResult1 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript1]];<br \/>\nNSString *strResult2 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript2]];<\/p>\n<p>\u7528NSString\u600e\u4e48\u628aUTF8\u8f6c\u6362\u6210unicode<br \/>\nutf8Str \/\/<br \/>\nNSString *unicodeStr = [NSString stringWithCString:[utf8Str UTF8String] encoding:NSUnicodeStringEncoding];<\/p>\n<p>View\u81ea\u5df1\u8c03\u7528\u81ea\u5df1\u7684\u65b9\u6cd5:<br \/>\n[self performSelector:@selector(loginToNext) withObject:nil afterDelay:2];\/\/\u9ec4\u8272\u6bb5\u4e3a\u65b9\u6cd5\u540d,\u548c\u5ef6\u8fdf\u51e0\u79d2\u6267\u884c.<\/p>\n<p>\u663e\u793a\u56fe\u50cf:<br \/>\nCGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);<br \/>\nUIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];<br \/>\n[myImage setImage:[UIImage imageNamed:@&#8221;myImage.png&#8221;]];<br \/>\nmyImage.opaque = YES; \/\/opaque\u662f\u5426\u900f\u660e<br \/>\n[self.view addSubview:myImage];<br \/>\n[myImage release];<\/p>\n<p>WebView:<br \/>\nCGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);<br \/>\nUIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];<br \/>\n[webView setBackgroundColor:[UIColor whiteColor]];<br \/>\nNSString *urlAddress = @&#8221;http:\/\/www.google.com&#8221;;<br \/>\nNSURL *url = [NSURL URLWithString:urlAddress];<br \/>\nNSURLRequest *requestObj = [NSURLRequest requestWithURL:url];<br \/>\n[webView loadRequest:requestObj];<br \/>\n[self addSubview:webView];<br \/>\n[webView release];<\/p>\n<p>\u663e\u793a\u7f51\u7edc\u6d3b\u52a8\u72b6\u6001\u6307\u793a\u7b26<br \/>\n\u8fd9\u662f\u5728iPhone\u5de6\u4e0a\u90e8\u7684\u72b6\u6001\u680f\u663e\u793a\u7684\u8f6c\u52a8\u7684\u56fe\u6807\u6307\u793a\u6709\u80cc\u666f\u53d1\u751f\u7f51\u7edc\u7684\u6d3b\u52a8\u3002<br \/>\nUIApplication* app = [UIApplication sharedApplication];<br \/>\napp.networkActivityIndicatorVisible = YES;<\/p>\n<p>\u52a8\u753b:\u4e00\u4e2a\u63a5\u4e00\u4e2a\u5730\u663e\u793a\u4e00\u7cfb\u5217\u7684\u56fe\u8c61<br \/>\nNSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@&#8221;myImage1.png&#8221;], [UIImage imageNamed:@&#8221;myImage2.png&#8221;], [UIImage imageNamed:@&#8221;myImage3.png&#8221;], [UIImage imageNamed:@&#8221;myImage4.gif&#8221;], nil];<br \/>\nUIImageView *myAnimatedView = [UIImageView alloc];<br \/>\n[myAnimatedView initWithFrame:[self bounds]];<br \/>\nmyAnimatedView.animationImages = myImages; \/\/animationImages\u5c5e\u6027\u8fd4\u56de\u4e00\u4e2a\u5b58\u653e\u52a8\u753b\u56fe\u7247\u7684\u6570\u7ec4<br \/>\nmyAnimatedView.animationDuration = 0.25; \/\/\u6d4f\u89c8\u6574\u4e2a\u56fe\u7247\u4e00\u6b21\u6240\u7528\u7684\u65f6\u95f4<br \/>\nmyAnimatedView.animationRepeatCount = 0; \/\/ 0 = loops forever \u52a8\u753b\u91cd\u590d\u6b21\u6570<br \/>\n[myAnimatedView startAnimating];<br \/>\n[self addSubview:myAnimatedView];<br \/>\n[myAnimatedView release];<\/p>\n<p>\u52a8\u753b:\u663e\u793a\u4e86something\u5728\u5c4f\u5e55\u4e0a\u79fb\u52a8\u3002\u6ce8\uff1a\u8fd9\u79cd\u7c7b\u578b\u7684\u52a8\u753b\u662f\u201c\u5f00\u59cb\u540e\u4e0d\u5904\u7406\u201d -\u4f60\u4e0d\u80fd\u83b7\u53d6\u4efb\u4f55\u6709\u5173\u7269\u4f53\u5728\u52a8\u753b\u4e2d\u7684\u4fe1\u606f(\u5982\u5f53\u524d\u7684\u4f4d\u7f6e) \u3002\u5982\u679c\u60a8\u9700\u8981\u6b64\u4fe1\u606f\uff0c\u60a8\u4f1a\u624b\u52a8\u4f7f\u7528\u5b9a\u65f6\u5668\u53bb\u8c03\u6574\u52a8\u753b\u7684X\u548cY\u5750\u6807<br \/>\n\u8fd9\u4e2a\u9700\u8981\u5bfc\u5165QuartzCore.framework<br \/>\nCABasicAnimation *theAnimation;<br \/>\ntheAnimation=[CABasicAnimation animationWithKeyPath:@&#8221;transform.translation.x&#8221;];<br \/>\n\/\/Creates and returns an CAPropertyAnimation instance for the specified key path.<br \/>\n\/\/parameter:the key path of the property to be animated<br \/>\ntheAnimation.duration=1;<br \/>\ntheAnimation.repeatCount=2;<br \/>\ntheAnimation.autoreverses=YES;<br \/>\ntheAnimation.fromValue=[NSNumber numberWithFloat:0];<br \/>\ntheAnimation.toValue=[NSNumber numberWithFloat:-60];<br \/>\n[view.layer addAnimation:theAnimation forKey:@&#8221;animateLayer&#8221;];<\/p>\n<p>Draggable items\/\/\u62d6\u52a8\u9879\u76ee<br \/>\nHere&#8217;s how to create a simple draggable image.\/\/\u8fd9\u662f\u5982\u4f55\u751f\u6210\u4e00\u4e2a\u7b80\u5355\u7684\u62d6\u52a8\u56fe\u8c61<br \/>\n1. Create a new class that inherits from UIImageView<br \/>\n@interface myDraggableImage : UIImageView { }<br \/>\n2. In the implementation for this new class, add the 2 methods:<br \/>\n&#8211; (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event<br \/>\n{<br \/>\n\/\/ Retrieve the touch point \u68c0\u7d22\u63a5\u89e6\u70b9<br \/>\nCGPoint pt = [[touches anyObject] locationInView:self];<br \/>\nstartLocation = pt;<br \/>\n[[self superview] bringSubviewToFront:self];<br \/>\n}<br \/>\n&#8211; (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event<br \/>\n{<br \/>\n\/\/ Move relative to the original touch point \u76f8\u5bf9\u4ee5\u524d\u7684\u89e6\u6478\u70b9\u8fdb\u884c\u79fb\u52a8<br \/>\nCGPoint pt = [[touches anyObject] locationInView:self];<br \/>\nCGRect frame = [self frame];<br \/>\nframe.origin.x += pt.x &#8211; startLocation.x;<br \/>\nframe.origin.y += pt.y &#8211; startLocation.y;<br \/>\n[self setFrame:frame];<br \/>\n}<br \/>\n3. Now instantiate the new class as you would any other new image and add it to your view<br \/>\n\/\/\u5b9e\u4f8b\u8fd9\u4e2a\u65b0\u7684\u7c7b,\u653e\u5230\u4f60\u9700\u8981\u65b0\u7684\u56fe\u7247\u653e\u5230\u4f60\u7684\u89c6\u56fe\u4e0a<br \/>\ndragger = [[myDraggableImage alloc] initWithFrame:myDragRect];<br \/>\n[dragger setImage:[UIImage imageNamed:@&#8221;myImage.png&#8221;]];<br \/>\n[dragger setUserInteractionEnabled:YES];<\/p>\n<p>\u7ebf\u7a0b:<br \/>\n1. Create the new thread:<br \/>\n[NSThread detachNewThreadSelector:@selector(myMethod) toTarget:self withObject:nil];<br \/>\n2. Create the method that is called by the new thread:<br \/>\n&#8211; (void)myMethod<br \/>\n{<br \/>\nNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br \/>\n*** code that should be run in the new thread goes here ***<br \/>\n[pool release];<br \/>\n}<br \/>\n\/\/What if you need to do something to the main thread from inside your new thread (for example, show a loading \/\/symbol)? Use performSelectorOnMainThread.<br \/>\n[self performSelectorOnMainThread:@selector(myMethod) withObject:nil waitUntilDone:false];<\/p>\n<p>Plist files<br \/>\nApplication-specific plist files can be stored in the Resources folder of the app bundle. When the app first launches, it should check if there is an existing plist in the user&#8217;s Documents folder, and if not it should copy the plist from the app bundle.<br \/>\n\/\/ Look in Documents for an existing plist file<br \/>\nNSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);<br \/>\nNSString *documentsDirectory = [paths objectAtIndex:0];<br \/>\nmyPlistPath = [documentsDirectory stringByAppendingPathComponent:<br \/>\n[NSString stringWithFormat: @&#8221;%@.plist&#8221;, plistName] ];<br \/>\n[myPlistPath retain];<br \/>\n\/\/ If it&#8217;s not there, copy it from the bundle<br \/>\nNSFileManager *fileManger = [NSFileManager defaultManager];<br \/>\nif ( ![fileManger fileExistsAtPath:myPlistPath] )<br \/>\n{<br \/>\nNSString *pathToSettingsInBundle = [[NSBundle mainBundle] pathForResource:plistName ofType:@&#8221;plist&#8221;];<br \/>\n}<br \/>\n\/\/Now read the plist file from Documents<br \/>\nNSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);<br \/>\nNSString *documentsDirectoryPath = [paths objectAtIndex:0];<br \/>\nNSString *path = [documentsDirectoryPath stringByAppendingPathComponent:@&#8221;myApp.plist&#8221;];<br \/>\nNSMutableDictionary *plist = [NSDictionary dictionaryWithContentsOfFile: path];<br \/>\n\/\/Now read and set key\/values<br \/>\nmyKey = (int)[[plist valueForKey:@&#8221;myKey&#8221;] intValue];<br \/>\nmyKey2 = (bool)[[plist valueForKey:@&#8221;myKey2&#8243;] boolValue];<br \/>\n[plist setValue:myKey forKey:@&#8221;myKey&#8221;];<br \/>\n[plist writeToFile:path atomically:YES];<\/p>\n<p>Alerts<br \/>\nShow a simple alert with OK button.<br \/>\nUIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:<br \/>\n@&#8221;An Alert!&#8221; delegate:self cancelButtonTitle:@&#8221;OK&#8221; otherButtonTitles:nil];<br \/>\n[alert show];<br \/>\n[alert release];<\/p>\n<p>Info button<br \/>\nIncrease the touchable area on the Info button, so it&#8217;s easier to press.<br \/>\nCGRect newInfoButtonRect = CGRectMake(infoButton.frame.origin.x-25, infoButton.frame.origin.y-25, infoButton.frame.size.width+50, infoButton.frame.size.height+50);<br \/>\n[infoButton setFrame:newInfoButtonRect];<\/p>\n<p>Detecting Subviews<br \/>\nYou can loop through subviews of an existing view. This works especially well if you use the &#8220;tag&#8221; property on your views.<br \/>\nfor (UIImageView *anImage in [self.view subviews])<br \/>\n{<br \/>\nif (anImage.tag == 1)<br \/>\n{ \/\/ do something }<br \/>\n}<\/p>\n<div>\u628aUIImagePickerController\u4f5c\u4e3asub view\u7684\u65b9\u6cd5<\/div>\n<div>2012-04-26 18:54<\/div>\n<table>\n<tbody>\n<tr>\n<td>\n<div id=\"blog_text\">\n<p>UIImagePickerController\u662f\u56fe\u7247\u9009\u62e9\u548c\u7167\u76f8\u673a\u63a7\u4ef6\u3002<\/p>\n<p>\u6309\u7167\u8fd9\u6837\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u62cd\u7167\uff1a<\/p>\n<p>UIImagePickerController *imagePickerController= [[UIImagePickerController\u00a0alloc]init];<\/p>\n<p>imagePickerController.sourceType=\u00a0UIImagePickerControllerSourceTypeCamera;<\/p>\n<p>&nbsp;<\/p>\n<p>[self\u00a0presentModalViewController:imagePickerController\u00a0animated:YES];<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f46\u662f\u5982\u679c\u4f60\u60f3\u628a\u5b83\u52a0\u6210\u4e00\u4e2asub view\uff0c\u4f60\u5c31\u4f1a\u53d1\u73b0\u5f97\u5230\u7684\u53ea\u662f\u4e00\u4e2a\u4e0d\u5b8c\u5168\u7684\u63a7\u4ef6\u3002<\/p>\n<p>[self.viewaddSubview:imagePickerController.view];<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\u5c31\u662f\u624b\u52a8\u8c03\u7528\u4e24\u4e2a\u521d\u59cb\u5316\u51fd\u6570\uff1a<\/p>\n<p>[imagePickerController\u00a0viewWillAppear:NO];<\/p>\n<p>[imagePickerController\u00a0viewDidAppear:NO];<\/p>\n<div><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; (NSString *)URLEncodedString:(NSString *)string &#8230; <a title=\"iphone\u5f00\u53d1\u5e38\u7528\u4ee3\u7801\" class=\"read-more\" href=\"https:\/\/www.sunyuping.com\/index.php\/2012\/07\/26\/iphone%e5%bc%80%e5%8f%91%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81\/\" aria-label=\"\u9605\u8bfb iphone\u5f00\u53d1\u5e38\u7528\u4ee3\u7801\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-uncategorized-2"],"_links":{"self":[{"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":0,"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sunyuping.com\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}