开发者

Why am I getting CGContext errors when installing an iPhone app?

Why am I getting the following errors when trying to install my iPhone application?

warning: Unable to read symbols for /Library/MobileSubstrate/MobileSubstrate.dylib (file not found).
warning: Unable to read symbols for /Library/Frameworks/CydiaSubstrate.framework/Libraries/SubstrateLoader.dylib (file not found).
2011-02-18 21:57:05.038 Catalog Dev[399:307] MS:Notice: Installing: com.yourcompany.Catalog-Dev [Catalog Dev] (550.32)
2011-02-18 21:57:05.210 Catalog Dev[399:307] MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/Activator.dylib
warning: Unable to read symbols for /Library/MobileSubstrate/DynamicLibraries/Activator.dylib (file not found).
2011-02-18 21:57:05.518 Catalog Dev[399:307] MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/sandcastleclient.dylib
warning: Unable to read symbols for /Library/MobileSubstrate/DynamicLibraries/sandcastleclient.dylib (file not found).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libsubstrate.dylib (file not found).
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextDrawImage: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextSetStrokeColorWithColor: invalid cont开发者_开发技巧ext 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextSetLineWidth: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextMoveToPoint: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextAddLineToPoint: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextAddLineToPoint: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextAddLineToPoint: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextAddLineToPoint: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGContextDrawPath: invalid context 0x0
Fri Feb 18 21:57:11 Moes-iPhone Catalog Dev[399] <Error>: CGBitmapContextCreateImage: invalid context 0x0


It seems that you are trying to install app that her deployment target is larger then your iPhone os version. Xcode is complaining that he is messing some lybreris your code is trying to use.


If you have created an app that makes use of a third-party framework (CydiaSubstrate.framework, for example), you will have to copy that framework into the Frameworks folder inside your application bundle.

An excellent tutorial for automating this process in Xcode can be found here.

Update:

<Error>: CGContextDrawImage: invalid context 0x0 

This error suggests that you have made a call to CGContextDrawImage but did not specify a valid CGContextRef argument. Without seeing the relevant code, I would have to guess at what is going on. The prototype for CGContextDrawImage is as follows:

void CGContextDrawImage (
    CGContextRef c,
    CGRect rect,
    CGImageRef image
);

The first argument must be a valid graphics context, usually the current drawing context, accessed as follows:

CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
...
CGContextDrawImage(myContext, someRect, someImage);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜