简体   繁体   English

如何在另一个Xcode项目中调用Xcode项目?

[英]How to Call Xcode Project In Another Xcode Project…?

I have develop one iphone application and now I want to Use this application as module in another project. 我已经开发了一个iphone应用程序,现在我想将此应用程序用作另一个项目中的模块。 How can I do this? 我怎样才能做到这一点?

您可以将n的projectA拖放到projectB(在Xcode中),或选择“将文件添加到”(不要选中“复制文件”选项)

将相关的类和资源复制到要将模块添加到的项目中,然后创建某种控制器界面(标签栏,导航控制器)以在两个项目(在复制到的项目中)之间导航

-(void)readPlist:(NSString *)viewName :(NSString *)teamName{
    F1WorldAppAppDelegate *f1Delegate = (F1WorldAppAppDelegate *)[[UIApplication sharedApplication] delegate];

    NSString *plistFileName = [self openPlist:viewName];
    NSMutableArray *dataArray = [[[NSMutableArray alloc] initWithContentsOfFile:plistFileName] autorelease];

    if ([viewName isEqualToString:@"News"]) {
        NSLog(@"%@",[dataArray description]);
        f1Delegate.newsDetails.stories = dataArray;
    }
    else if ([viewName isEqualToString:@"Team"]){
        NSMutableDictionary *dataDictionary = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistFileName] autorelease];

        f1Delegate.teamDetails.stories = [dataDictionary objectForKey:teamName];
    }
    else if ([viewName isEqualToString:@"Schedule"]){
        f1Delegate.scheduleDetails.stories = dataArray;

    }
    else if ([viewName isEqualToString:@"Drivers"]){
        f1Delegate.driverDetails.stories = dataArray;
    }
    else if ([viewName isEqualToString:@"TeamDetails"]){
        f1Delegate.teamDetails.teamsDetails = dataArray;
    }

}
-(IBAction)btnclick:(id)sender{   
   NSURL *fileURL = [NSURL fileURLWithPath:[@"/Users/new1/Desktop/temp.txt" stringByExpandingTildeInPath]];    
NSError *error = nil;
NSString *fileContentsString = [NSString stringWithContentsOfURL:fileURL 
                                                        encoding:NSUTF8StringEncoding 
                                                           error:&error];    
if (!fileContentsString) {
    NSLog(@"Error reading file");
}    
NSString *url;
if (![[[[txtFld stringValue] componentsSeparatedByString:@"//"] objectAtIndex:0] isEqualToString:@"http:"]){
     url = [[[txtFld stringValue] componentsSeparatedByString:@"."] objectAtIndex:0];
}
else{
     url = [[[txtFld stringValue] componentsSeparatedByString:@"."] objectAtIndex:1];
}
NSRange result = [fileContentsString rangeOfString:url];    
if (result.location == NSNotFound) {
    NSLog(@"URL not found in file"); 
    NSAlert *alrt = [[NSAlert alloc] init];
    NSString *alrtstr = [NSString stringWithFormat:@"Not Authorise person to open : %@",[txtFld stringValue]];
    [alrt setMessageText:alrtstr];
    [alrt runModal];
    NSLog(@"btn clicked ");
}
else{     
    NSLog(@"URL found in file : %@",[txtFld stringValue]);
    if (![[[[txtFld stringValue] componentsSeparatedByString:@"//"] objectAtIndex:0] isEqualToString:@"http:"]){
        [webVw setMainFrameURL:[NSString stringWithFormat:@"http://%@",[txtFld stringValue]]]; 
    }
    else{
        [webVw setMainFrameURL:[txtFld stringValue]];
    }
} 

}
-(IBAction)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame{
    NSString *currentURL = [webVw stringByEvaluatingJavaScriptFromString:@"location.href;"];
    NSLog(@"%@",currentURL);
    [txtFld setStringValue:currentURL];
}
NSString *url=@"ftp://josskl:Crystal88*@josskl.ipower.com/public_html/kidsnetplayground/download/version.txt";
NSLog(@"%@",[clsLicence startStreaming:url]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM