I examined the numerical value of NSScannedOption and decided to give
this a try in RegexKitLite.m:
#ifndef iPhone
else { if((splitStrings = rkl_realloc(&scratchBuffer[1],
splitStringsSize, (NSUInteger)NSScannedOption)) == NULL) { goto
exitNow; } } # <<<< original line 579
#else
else { if((splitStrings = rkl_realloc(&scratchBuffer[1],
splitStringsSize, (NSUInteger)1)) == NULL) { goto exitNow; } }
#endif
Now the test app link_example.m app installs and runs on a real phone.
Whether this actually solves a problem with the code running on an
iPhone, I do not know. I'm a newcomer to the Mac, and fixing one
problem may cause another. iow, my fix is naive.
I also decided to try to figure out where NSScannedOption originates,
and found this:
$ sudo find /usr /System/ /Developer/ -name \*.h |xargs grep
NSScannedOption 2>/dev/null
/System//Library/Frameworks/Foundation.framework/Versions/C/Headers/
NSZone.h: NSScannedOption = (1<<0),
/Developer//Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/
System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:
NSScannedOption = (1<<0),
/Developer//Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/
Versions/C/Headers/NSZone.h: NSScannedOption = (1<<0),
/Developer//SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
Foundation.framework/Versions/C/Headers/NSZone.h: NSScannedOption =
(1<<0)
/Developer//SDKs/MacOSX10.5.sdk/System/Library/Frameworks/
Foundation.framework/Versions/C/Headers/NSZone.h: NSScannedOption =
(1<<0),
indicating that NSScannedOption lies completely within NSZone.h, at
least in the likely directory trees.
My guess is that the build process for the iPhone simulator config
differs from the device config in some way that includes NSZone.h for
the former, but not the latter. Or some such.
On Aug 15, 2008, at 3:52 PM, Mark Petrovic wrote:
> Good day.
>
> I'm attempting to use the RegexKitLite code in an iPhone app. When
> I attempt to build the application for deployment to a real phone,
> Xcode produces an error to the effect:
>
> error: 'NSScannedOption' undeclared (first use in this function)
> RegexKitLite.m line 579
>
> I'm fairly new to Mac and iPhone programming, and I suspect this
> class is not available in the iPhone SDK. Is there a workaround for
> this?
>
> I would note that building the app to run in the simulator works
> fine. Only when I build for the real device do I run into this
> unresolved reference.
>
> Thanks.
|