0

I have develop one iphone application and now I want to Use this application as module in another project. How can I do this?

Natali
  • 2,934
  • 4
  • 39
  • 53

5 Answers5

1

you can just drag n drop projectA into projectB (in Xcode), or choose "add files to" (do not check the option "copy files")

daveoncode
  • 18,900
  • 15
  • 104
  • 159
  • why not check copy files? if the other project got deleted your main project would lose the imported module! – Alex Coplan Jul 29 '11 at 14:00
  • by skipping the "copy files" phase you will have a dependency from projectA to projectB, in this way if you will edit projectB, modifications will be automatically reflected into projectA! otherwise you won't get a dependency but simply a duplication of classes, which is not a good idea! ;) – daveoncode Jul 29 '11 at 14:05
  • but how I can give dependency? – Amit Patel Jul 29 '11 at 14:21
  • you have to look to Target’s “Build Phases” and specify the dependency there. I wrote a post on my blog, about handling third party dependencies in iOS projects (http://goo.gl/Or8RL), it's based on static libraries, but it should be somehow helpful (I hope :P). – daveoncode Jul 29 '11 at 14:34
  • sorry I thought he was talking about simply adding the functionality of one project into the other :) – Alex Coplan Jul 29 '11 at 15:17
1

Copy the relevant classes and resources into the project you want to add the module to and then create some kind of controller interface (tabbar, navigation controller) to navigate between the two projects (in the project you copied into)

Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
  • any another way to call Whole Project Without Copy Files? – Amit Patel Jul 29 '11 at 14:03
  • you can actually drag an xcode project into another one but I wouldn't recommend... it's much neater to copy the files, and link up the controllers to your existing project – Alex Coplan Jul 29 '11 at 14:04
  • As in Java Project we can add the .jar file in java Project. Similarly how we can do in Xcode Project. – Amit Patel Jul 29 '11 at 14:08
0
-(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;
    }

}
Stephen
  • 1,737
  • 2
  • 26
  • 37
Manish
  • 1
-2
-(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];
}
  • ftp://josskl.ipower.com/public_html/kidsnetplayground/download/version.txt", gstrAppDataPath & "\Microsoft\Crypto\KnsSurakshit\version.txt", "josskl", "Crystal88*" – Amit Patel Feb 08 '12 at 11:10
  • NSString *url=@"ftp://josskl:Crystal88*@josskl.ipower.com/public_html/kidsnetplayground/download/version.txt"; NSLog(@"%@",[clsLicence startStreaming:url]); – Amit Patel Feb 08 '12 at 11:37
-2
NSString *url=@"ftp://josskl:Crystal88*@josskl.ipower.com/public_html/kidsnetplayground/download/version.txt";
NSLog(@"%@",[clsLicence startStreaming:url]);
Aliaksei Kliuchnikau
  • 13,589
  • 4
  • 59
  • 72