IOS use private framework

Source: Internet
Author: User

Https://github.com/nst/iOS-Runtime-Headers

Private framework has two scenarios,

1. The framework has been loaded, but the header file has not been exported. In this case, you only need to add the header file to the project and call it directly.

As shown in the following code: _ mfsocket

2. If the framework is not loaded, add the framework and header file to the project and call it later.

As in the following code, uiprogresshud

Example:

#import "ViewController.h"#import "UIASyntheticEvents.h"#import "MFSocket.h"#import "UIProgressHUD.h"#import "UIAlertTextView.h"@implementation ViewController- (void)didReceiveMemoryWarning{    [super didReceiveMemoryWarning];    // Release any cached data, images, etc that aren't in use.}#pragma mark - View lifecycle- (void)viewDidLoad{    [super viewDidLoad];    //UIASyntheticEvents *events = [UIASyntheticEvents sharedEventGenerator];    //[events lockDevice];        _MFSocket *socket = [[_MFSocket alloc] init];    BOOL isOK = [socket connectToHost:@"127.0.0.1" withPort:8888 service:nil];    if (isOK) {        int bufferLength = 1024;        char *buffer = malloc(bufferLength * sizeof(char));        int length = [socket readBytes:buffer length:bufferLength];                NSLog(@"read length -> %d", length);        NSLog(@"read string -> %@", [NSString stringWithCString:buffer encoding:NSUTF8StringEncoding]);                NSString *command = @"Hello World. \n\r";        [socket writeBytes:[command UTF8String] length:[command length]];            }        [socket release];        UIProgressHUD *progressHUD = [[UIProgressHUD alloc] initWithFrame:CGRectMake(50., 50., 100., 100.)];    //[progressHUD setText:@"Loading..."];    [progressHUD setShowsText:YES];    [progressHUD showInView:self.view];    //[progressHUD setFontSize:12];    [progressHUD release];     }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.