Click here to Skip to main content
15,795,937 members
Home / Discussions / Objective-C and Swift
   

Objective-C and Swift

 
QuestionLinker command failed with exit code 1 (use -v to see invocation) in xcode 5.1.1 Pin
Member 1198376314-Sep-15 11:17
Member 1198376314-Sep-15 11:17 
QuestionImagePickerController image size Pin
liel333-Aug-15 12:30
liel333-Aug-15 12:30 
AnswerRe: ImagePickerController image size Pin
biji cabe18-Dec-16 23:25
biji cabe18-Dec-16 23:25 
QuestioniOS XMPP received message in coversation screen Pin
Member 1176696715-Jun-15 3:37
Member 1176696715-Jun-15 3:37 
SuggestionRe: iOS XMPP received message in coversation screen Pin
Richard MacCutchan15-Jun-15 5:19
mveRichard MacCutchan15-Jun-15 5:19 
GeneralRe: iOS XMPP received message in coversation screen Pin
Member 1176696715-Jun-15 21:42
Member 1176696715-Jun-15 21:42 
AnswerRe: iOS XMPP received message in coversation screen Pin
Dennis E White17-Jun-15 6:54
professionalDennis E White17-Jun-15 6:54 
Questionmake a system monitor using obj c. Pin
Member 116779679-May-15 14:00
Member 116779679-May-15 14:00 
AnswerRe: make a system monitor using obj c. Pin
Richard MacCutchan9-May-15 22:10
mveRichard MacCutchan9-May-15 22:10 
GeneralRe: make a system monitor using obj c. Pin
Dennis E White15-May-15 6:25
professionalDennis E White15-May-15 6:25 
GeneralRe: make a system monitor using obj c. Pin
Richard MacCutchan15-May-15 6:41
mveRichard MacCutchan15-May-15 6:41 
GeneralRe: make a system monitor using obj c. Pin
Dennis E White15-May-15 7:04
professionalDennis E White15-May-15 7:04 
GeneralApp that converts human years to dog years Pin
Member 115920608-Apr-15 16:44
Member 115920608-Apr-15 16:44 
GeneralRe: App that converts human years to dog years Pin
Dennis E White11-Apr-15 10:34
professionalDennis E White11-Apr-15 10:34 
GeneralRe: App that converts human years to dog years Pin
Richard MacCutchan11-Apr-15 23:05
mveRichard MacCutchan11-Apr-15 23:05 
GeneralRe: App that converts human years to dog years Pin
Dennis E White13-Apr-15 11:09
professionalDennis E White13-Apr-15 11:09 
QuestionCan anyone help me solve this project? Pin
Member 115772012-Apr-15 14:46
Member 115772012-Apr-15 14:46 
AnswerRe: Can anyone help me solve this project? Pin
Sascha Lefèvre2-Apr-15 15:23
professionalSascha Lefèvre2-Apr-15 15:23 
AnswerRe: Can anyone help me solve this project? Pin
Dennis E White11-Apr-15 10:32
professionalDennis E White11-Apr-15 10:32 
AnswerRe: Can anyone help me solve this project? Pin
Peter Webb5-May-15 4:30
Peter Webb5-May-15 4:30 
QuestionLaunch Safari from another app then Autofill username and password Pin
picardy8-Jan-15 9:45
picardy8-Jan-15 9:45 
AnswerRe: Launch Safari from another app then Autofill username and password Pin
Dennis E White27-Jan-15 6:11
professionalDennis E White27-Jan-15 6:11 
AnswerRe: Launch Safari from another app then Autofill username and password Pin
C3D130-Jan-15 4:46
professionalC3D130-Jan-15 4:46 
QuestionStart java program from Objective C code Pin
DraqueD5-Jan-15 9:42
DraqueD5-Jan-15 9:42 
I'm trying to make a pretty simple frontend program that's able to start up a java program when it's run, but haven't yet mastered OC. Someone suggested that I try using a console command (code below), but I haven't been able to make that work yet.

Is there an easier way to do this, or does any one here know where my code has gone wrong?

C#
int main(int argc, const char * argv[]) {

    NSFileManager *filemgr;
    NSString *currentpath;

    filemgr = [[NSFileManager alloc] init];

    currentpath = [filemgr currentDirectoryPath];

    NSPipe *pipe = [NSPipe pipe];
    NSFileHandle *file = pipe.fileHandleForReading;

    NSTask *task = [[NSTask alloc] init];
    task.launchPath = [currentpath stringByAppendingString:@"/java"];
    task.arguments = @[@"-jar", @"PolyGlot.jar"], [NSString stringWithFormat:@"%c", argv]];
    task.standardOutput = pipe;

    [task launch];

    NSData *data = [file readDataToEndOfFile];
    [file closeFile];

    NSString *grepOutput = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
    NSLog (@"grep returned:\n%@", grepOutput);

    return 0;
}


When I run this, I get the error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'

I know that the current path is accessible, though... so I'm kind of stumped here. Any help would be much appreciated. Thanks!
AnswerRe: Start java program from Objective C code Pin
jschell5-Jan-15 10:37
jschell5-Jan-15 10:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.