Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to copy Xcode project to another version of OS X
    primarykey
    data
    text
    <p>I create a project with Xcode 4.5.1 on OS X 10.8. Configurations are: Project: Architectures: Standard (32/64-bit intel) Base SDK: OS X 10.7 Deployment Target: 10.7</p> <p>At first everything goes smoothly.However, when I copy this project to another Macbook with Xcode 4.4.1 on OS X 10.7, runtime errors are thrown.</p> <hr> <p>Configurations above un changed, and error occurs at a method that fetch configuration string from file:</p> <pre><code>+(NSString *)configValueFromFile:(NSString *)path withParameter:(NSString *)parameter { const char *cPath = [path UTF8String]; const char *cPara = [[parameter uppercaseString] UTF8String]; char buff[CFG_CONFIG_READ_TOOL_BUFFER_LEN]; size_t paraLen = [parameter length]; size_t lineLen; FILE *fileFd = NULL; //struct stat dummyFileStat; BOOL isValueFound = NO; NSString *ret = nil; /* open file *//* if (0 != stat(cPath, &amp;dummyFileStat)) { NSLog(@"stat() %@: %@", path, [AMCTools strError]); return nil; }*/ fileFd = fopen(cPath, "r"); if(!fileFd) { NSLog(@"fopen() %@: %@", path, [AMCTools strError]); return nil; } /* read configuration */ while((!feof(fileFd)) &amp;&amp; (!isValueFound)) { @autoreleasepool { size_t tmp; fgets(buff, sizeof(buff), fileFd); if ('\0' == buff[sizeof(buff) - 1]) { break; } /* get a line */ lineLen = strlen(buff); if ((0 == lineLen) || ('#' == buff[0])) { continue; /* !!!!!!! */ } while(('\n' == buff[lineLen - 1]) || ('\r' == buff[lineLen - 1])) { buff[lineLen - 1] = '\0'; lineLen --; } //NSLog(@"Get line: %s", buff); /* upper case the parameter */ for (tmp = 0; (tmp &lt; lineLen) || ('=' != buff[tmp]); tmp++) { if ((buff[tmp] &gt;= 'a') &amp;&amp; (buff[tmp] &lt;= 'z')) { buff[tmp] += 'A' - 'a'; } } /* compare */ if (0 == strncmp(cPara, buff, paraLen)) { isValueFound = YES; /* fetch value sector */ for (tmp = paraLen; tmp &lt; lineLen; tmp++) { if ('=' == buff[tmp]) { tmp++; break; } } // end: for (tmp = paraLen...) if (tmp &gt;= lineLen) { /* no parameter values */ ret = @""; } else { /* skip blank */ for (/**/; tmp &lt; lineLen; tmp++) { if ((' ' != buff[tmp]) &amp;&amp; ('\t' != buff[tmp])) { break; } } ret = [NSString stringWithUTF8String:buff+tmp]; } } // end: compare } // end: autoreleasepool } //end: while(...) ENDS: if (fileFd) { fclose(fileFd); } return ret; } </code></pre> <p>This Method goes fine until the "return ret", which throws a error "<b>Thread 1: signal SIGABRT</b>";<br/></p> <hr> <p>What should I do?</p> <p>Thanks!!</p> <hr> <p>Further information for <i>Cody</i>:</p> <ol> <li>About your concern:</li> </ol> <p>Oh, I forgot mentioning that I did use ARC. It should had not been release. </p> <p>You mentioned about the line:</p> <pre><code>const char *cPara = [[parameter uppercaseString] UTF8String]; </code></pre> <p>If it is not appropriate, how should I correct it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload