簡體   English   中英

如何在另一個Xcode項目中調用Xcode項目?

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

我已經開發了一個iphone應用程序,現在我想將此應用程序用作另一個項目中的模塊。 我怎樣才能做到這一點?

您可以將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